apt: cache_api: simplify match with unwrap_or_default

Fixes:

warning: match can be simplified with `.unwrap_or_default()`
  --> proxmox-apt/src/cache_api.rs:77:28
   |
77 |           let mut notified = match cache.notified {
   |  ____________________________^
78 | |             Some(notified) => notified,
79 | |             None => std::collections::HashMap::new(),
80 | |         };
   | |_________^ help: replace it with: `cache.notified.unwrap_or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
   = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
Maximiliano Sandoval 2024-08-26 14:15:32 +02:00 committed by Wolfgang Bumiller
parent a2e5973982
commit f8f57540c6

View File

@ -74,10 +74,7 @@ pub fn update_database<P: AsRef<Path>>(
let mut cache = crate::cache::update_cache(apt_state_file)?;
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 {