Skip to content

Commit

Permalink
use contains_key instead of entry
Browse files Browse the repository at this point in the history
  • Loading branch information
tangowithfoxtrot committed Jun 12, 2024
1 parent 55c9e72 commit 0c6128a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/bws/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,16 @@ async fn process_commands() -> Result<()> {
);
}

Check warning on line 481 in crates/bws/src/main.rs

View check run for this annotation

Codecov / codecov/patch

crates/bws/src/main.rs#L476-L481

Added lines #L476 - L481 were not covered by tests

match environment.entry(key) {
std::collections::hash_map::Entry::Occupied(duplicate) => {
match environment.contains_key(&key) {

Check warning on line 483 in crates/bws/src/main.rs

View check run for this annotation

Codecov / codecov/patch

crates/bws/src/main.rs#L483

Added line #L483 was not covered by tests
true => {
eprintln!(
"Error: multiple secrets with name '{}' found. Use --uuids-as-keynames or use unique names for secrets.",
duplicate.key()
key
);
std::process::exit(1);

Check warning on line 489 in crates/bws/src/main.rs

View check run for this annotation

Codecov / codecov/patch

crates/bws/src/main.rs#L485-L489

Added lines #L485 - L489 were not covered by tests
}
std::collections::hash_map::Entry::Vacant(entry) => {
entry.insert(s.value);
false => {
environment.insert(key, s.value);
}
}
});
Expand Down

0 comments on commit 0c6128a

Please sign in to comment.