From d27911513b1b6fc4d48d4a8f316e780b765f6c7a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 27 Mar 2021 11:18:32 +0200 Subject: refactor: drop unnecessary clones --- src/genlist.rs | 2 +- src/index.rs | 4 ++-- 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) -> 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![]); } -- cgit v1.2.1