Skip to content

Commit 0d7c621

Browse files
committed
src: Fix 'contains_key' clippy lints
``` warning: unnecessary use of `get(k).is_some()` --> src/filetree.rs:187:34 | 187 | if self.children.get(k).is_some() { | ^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(k)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default ```
1 parent 2a2a0f0 commit 0d7c621

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bootupd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ pub(crate) fn adopt_and_update(name: &str) -> Result<ContentMetadata> {
249249
let sysroot = openat::Dir::open("/")?;
250250
let mut state = SavedState::load_from_disk("/")?.unwrap_or_default();
251251
let component = component::new_from_name(name)?;
252-
if state.installed.get(name).is_some() {
252+
if state.installed.contains_key(name) {
253253
anyhow::bail!("Component {} is already installed", name);
254254
};
255255

src/filetree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl FileTree {
184184
}
185185
if check_additions {
186186
for k in updated.children.keys() {
187-
if self.children.get(k).is_some() {
187+
if self.children.contains_key(k) {
188188
continue;
189189
}
190190
additions.insert(k.clone());

0 commit comments

Comments
 (0)