forked from Proxmox/proxmox
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:
parent
a2e5973982
commit
f8f57540c6
@ -74,10 +74,7 @@ pub fn update_database<P: AsRef<Path>>(
|
|||||||
let mut cache = crate::cache::update_cache(apt_state_file)?;
|
let mut cache = crate::cache::update_cache(apt_state_file)?;
|
||||||
|
|
||||||
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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user