trivial clippy fixes

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-06-25 13:37:35 +02:00
parent 71bf1a3b12
commit 8c75fcd07c
2 changed files with 4 additions and 7 deletions

View File

@ -100,7 +100,7 @@ impl Bucket {
let ty = ty.as_ref(); let ty = ty.as_ref();
haystack.iter_mut().find(|b| match b { haystack.iter_mut().find(|b| match b {
Bucket::Partition(data) => { Bucket::Partition(data) => {
if let Some(comp) = comp.get(0) { if let Some(comp) = comp.first() {
ty == "part" && comp.as_ref().parse::<i32>().unwrap() == data.number ty == "part" && comp.as_ref().parse::<i32>().unwrap() == data.number
} else { } else {
false false
@ -108,14 +108,14 @@ impl Bucket {
} }
Bucket::RawFs(_) => ty == "raw", Bucket::RawFs(_) => ty == "raw",
Bucket::ZPool(data) => { 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 ty == "zpool" && comp.as_ref() == data.name
} else { } else {
false false
} }
} }
Bucket::LVM(data) => { 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 ty == "lvm" && vg.as_ref() == data.vg_name && lv.as_ref() == data.lv_name
} else { } else {
false false

View File

@ -166,10 +166,7 @@ pub fn apt_update_database(
let mut cache = apt::update_cache()?; let mut cache = apt::update_cache()?;
if notify { if notify {
let mut notified = match cache.notified { let mut notified = cache.notified.unwrap_or_default();
Some(notified) => notified,
None => std::collections::HashMap::new(),
};
let mut to_notify: Vec<&APTUpdateInfo> = Vec::new(); let mut to_notify: Vec<&APTUpdateInfo> = Vec::new();
for pkg in &cache.package_status { for pkg in &cache.package_status {