diff --git a/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs b/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs index 4991479c..20ddfc6b 100644 --- a/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs +++ b/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs @@ -100,7 +100,7 @@ impl Bucket { let ty = ty.as_ref(); haystack.iter_mut().find(|b| match b { Bucket::Partition(data) => { - if let Some(comp) = comp.get(0) { + if let Some(comp) = comp.first() { ty == "part" && comp.as_ref().parse::().unwrap() == data.number } else { false @@ -108,14 +108,14 @@ impl Bucket { } Bucket::RawFs(_) => ty == "raw", Bucket::ZPool(data) => { - if let Some(ref comp) = comp.get(0) { + if let Some(ref comp) = comp.first() { ty == "zpool" && comp.as_ref() == data.name } else { false } } Bucket::LVM(data) => { - if let (Some(ref vg), Some(ref lv)) = (comp.get(0), comp.get(1)) { + if let (Some(ref vg), Some(ref lv)) = (comp.first(), comp.get(1)) { ty == "lvm" && vg.as_ref() == data.vg_name && lv.as_ref() == data.lv_name } else { false diff --git a/src/api2/node/apt.rs b/src/api2/node/apt.rs index 9c0d9ecc..0ae353d5 100644 --- a/src/api2/node/apt.rs +++ b/src/api2/node/apt.rs @@ -166,10 +166,7 @@ pub fn apt_update_database( let mut cache = apt::update_cache()?; if notify { - let mut notified = match cache.notified { - Some(notified) => notified, - None => std::collections::HashMap::new(), - }; + let mut notified = cache.notified.unwrap_or_default(); let mut to_notify: Vec<&APTUpdateInfo> = Vec::new(); for pkg in &cache.package_status {