clippy: use copied/cloned instead of map

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-01-19 11:30:30 +01:00
parent a3775bb4e8
commit a375df6f4c
3 changed files with 4 additions and 4 deletions

View File

@ -1466,7 +1466,7 @@ async fn prune_async(mut param: Value) -> Result<Value, Error> {
if quiet {
let list: Vec<Value> = data.as_array().unwrap().iter().filter(|item| {
item["keep"].as_bool() == Some(false)
}).map(|v| v.clone()).collect();
}).cloned().collect();
data = list.into();
}

View File

@ -300,7 +300,7 @@ impl Inventory {
}
pub fn media_set_start_time(&self, media_set_uuid: &Uuid) -> Option<i64> {
self.media_set_start_times.get(media_set_uuid).map(|t| *t)
self.media_set_start_times.get(media_set_uuid).copied()
}
/// Lookup media set pool

View File

@ -323,7 +323,7 @@ impl MediaCatalog {
/// Returns the chunk archive file number
pub fn lookup_snapshot(&self, snapshot: &str) -> Option<u64> {
self.snapshot_index.get(snapshot).map(|n| *n)
self.snapshot_index.get(snapshot).copied()
}
/// Test if the catalog already contain a chunk
@ -333,7 +333,7 @@ impl MediaCatalog {
/// Returns the chunk archive file number
pub fn lookup_chunk(&self, digest: &[u8;32]) -> Option<u64> {
self.chunk_index.get(digest).map(|n| *n)
self.chunk_index.get(digest).copied()
}
fn check_register_label(&self, file_number: u64) -> Result<(), Error> {