diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-27 11:20:12 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-27 11:20:12 +0200 |
commit | b3dc71521f9a24ba1d7c13a4d599589af858cdde (patch) | |
tree | b512dfbcb5867d92418b1afd2bcd4ea1c55d3916 | |
parent | d27911513b1b6fc4d48d4a8f316e780b765f6c7a (diff) | |
download | obnam2-b3dc71521f9a24ba1d7c13a4d599589af858cdde.tar.gz |
refactor: use .cloned() to clone items in an iterator
-rw-r--r-- | src/genlist.rs | 2 | ||||
-rw-r--r-- | src/indexedstore.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/genlist.rs b/src/genlist.rs index dbc437a..9d7e39d 100644 --- a/src/genlist.rs +++ b/src/genlist.rs @@ -33,7 +33,7 @@ impl GenerationList { let hits: Vec<FinishedGeneration> = self .iter() .filter(|gen| gen.id() == genref) - .map(|gen| gen.clone()) + .cloned() .collect(); if hits.len() == 1 { Some(hits[0].clone()) diff --git a/src/indexedstore.rs b/src/indexedstore.rs index f2d1831..7f67a1f 100644 --- a/src/indexedstore.rs +++ b/src/indexedstore.rs @@ -84,7 +84,7 @@ impl IndexedStore { let file_chunks = all_chunk_ids .iter() .filter(|id| !sql_chunks.contains(id)) - .map(|id| id.clone()) + .cloned() .collect(); Ok(file_chunks) |