diff --git a/src/bootupd.rs b/src/bootupd.rs index 3e6ac088..c16a885c 100644 --- a/src/bootupd.rs +++ b/src/bootupd.rs @@ -249,7 +249,7 @@ pub(crate) fn adopt_and_update(name: &str) -> Result { let sysroot = openat::Dir::open("/")?; let mut state = SavedState::load_from_disk("/")?.unwrap_or_default(); let component = component::new_from_name(name)?; - if state.installed.get(name).is_some() { + if state.installed.contains_key(name) { anyhow::bail!("Component {} is already installed", name); }; diff --git a/src/filetree.rs b/src/filetree.rs index af890bfb..b8648dd6 100644 --- a/src/filetree.rs +++ b/src/filetree.rs @@ -184,7 +184,7 @@ impl FileTree { } if check_additions { for k in updated.children.keys() { - if self.children.get(k).is_some() { + if self.children.contains_key(k) { continue; } additions.insert(k.clone());