mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-07 13:33:17 +00:00
apt: repositories: use if-let instead of match for Option
Fixes the single_match clippy lint: ``` warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> proxmox-apt/src/repositories/mod.rs:41:9 | 41 | / match digest { 42 | | Some(digest) => common_raw.extend_from_slice(&digest[..]), 43 | | None => (), 44 | | } | |_________^ help: try: `if let Some(digest) = digest { common_raw.extend_from_slice(&digest[..]) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match = note: `#[warn(clippy::single_match)]` on by default ``` Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
parent
90e4dc5f8f
commit
1b5e8ee0dd
@ -38,9 +38,8 @@ fn common_digest(files: &[APTRepositoryFile]) -> ConfigDigest {
|
|||||||
|
|
||||||
let mut common_raw = Vec::<u8>::with_capacity(digests.len() * 32);
|
let mut common_raw = Vec::<u8>::with_capacity(digests.len() * 32);
|
||||||
for digest in digests.values() {
|
for digest in digests.values() {
|
||||||
match digest {
|
if let Some(digest) = digest {
|
||||||
Some(digest) => common_raw.extend_from_slice(&digest[..]),
|
common_raw.extend_from_slice(&digest[..]);
|
||||||
None => (),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user