summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-27 11:18:32 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-27 11:18:32 +0200
commitd27911513b1b6fc4d48d4a8f316e780b765f6c7a (patch)
tree6179c54a9d3089dc0a8d68d83a413f7740a8d3da
parent3592fb5dff0384ed82c5146059caa6840263ebbe (diff)
downloadobnam2-d27911513b1b6fc4d48d4a8f316e780b765f6c7a.tar.gz
refactor: drop unnecessary clones
-rw-r--r--src/genlist.rs2
-rw-r--r--src/index.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/genlist.rs b/src/genlist.rs
index 5eec248..dbc437a 100644
--- a/src/genlist.rs
+++ b/src/genlist.rs
@@ -13,7 +13,7 @@ pub enum GenerationListError {
impl GenerationList {
pub fn new(gens: Vec<FinishedGeneration>) -> Self {
- let mut list = gens.clone();
+ let mut list = gens;
list.sort_by_cached_key(|gen| gen.ended().to_string());
Self { list }
}
diff --git a/src/index.rs b/src/index.rs
index 6628b50..83f854c 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -138,7 +138,7 @@ mod test {
let meta = ChunkMeta::new_generation("abc", "timestamp");
let dir = tempdir().unwrap();
let mut idx = new_index(dir.path());
- idx.insert_meta(id.clone(), meta.clone()).unwrap();
+ idx.insert_meta(id.clone(), meta).unwrap();
assert_eq!(idx.find_generations().unwrap(), vec![id]);
}
@@ -148,7 +148,7 @@ mod test {
let meta = ChunkMeta::new_generation("abc", "timestamp");
let dir = tempdir().unwrap();
let mut idx = new_index(dir.path());
- idx.insert_meta(id.clone(), meta.clone()).unwrap();
+ idx.insert_meta(id.clone(), meta).unwrap();
idx.remove_meta(&id).unwrap();
assert_eq!(idx.find_generations().unwrap(), vec![]);
}