apt: file: Use unwrap_or_default instead of match

Fixes the manual_unwrap_or_default clippy lint:

```
warning: match can be simplified with `.unwrap_or_default()`
   --> proxmox-apt/src/repositories/file.rs:369:30
    |
369 |               let mut origin = match repo.get_cached_origin(apt_lists_dir) {
    |  ______________________________^
370 | |                 Ok(option) => option,
371 | |                 Err(_) => None,
372 | |             };
    | |_____________^ help: replace it with: `repo.get_cached_origin(apt_lists_dir).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-12-03 11:20:29 +01:00 committed by Fabian Grünbichler
parent 9205e65d21
commit 8062e1abb3

View File

@ -366,10 +366,7 @@ impl APTRepositoryFileImpl for APTRepositoryFile {
};
for (n, repo) in self.repositories.iter().enumerate() {
let mut origin = match repo.get_cached_origin(apt_lists_dir) {
Ok(option) => option,
Err(_) => None,
};
let mut origin = repo.get_cached_origin(apt_lists_dir).unwrap_or_default();
if origin.is_none() {
origin = repo.origin_from_uris();