From 70fab20193bfdf147f4320d58ef620d9ae3b246a Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Tue, 19 Jan 2021 09:46:11 +0000 Subject: [PATCH] maps: hash map: remove Clone bound --- src/maps/hash_map.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/maps/hash_map.rs b/src/maps/hash_map.rs index ad289839..8f05ec43 100644 --- a/src/maps/hash_map.rs +++ b/src/maps/hash_map.rs @@ -98,13 +98,13 @@ impl<'a, K: Pod, V: Pod> TryFrom<&'a mut Map> for HashMap<&'a mut Map, K, V> { } } -pub struct MapKeys<'coll, T: AsRef, K: Clone + Pod, V: Clone + Pod> { +pub struct MapKeys<'coll, T: AsRef, K: Pod, V: Pod> { map: &'coll HashMap, err: bool, key: Option, } -impl<'coll, T: AsRef, K: Clone + Pod, V: Clone + Pod> MapKeys<'coll, T, K, V> { +impl<'coll, T: AsRef, K: Pod, V: Pod> MapKeys<'coll, T, K, V> { fn new(map: &'coll HashMap) -> MapKeys<'coll, T, K, V> { MapKeys { map, @@ -114,7 +114,7 @@ impl<'coll, T: AsRef, K: Clone + Pod, V: Clone + Pod> MapKeys<'coll, T, K, } } -impl, K: Clone + Pod, V: Clone + Pod> Iterator for MapKeys<'_, T, K, V> { +impl, K: Pod, V: Pod> Iterator for MapKeys<'_, T, K, V> { type Item = Result; fn next(&mut self) -> Option> { @@ -147,11 +147,11 @@ impl, K: Clone + Pod, V: Clone + Pod> Iterator for MapKeys<'_, T, } } -pub struct MapIter<'coll, T: AsRef, K: Clone + Pod, V: Clone + Pod> { +pub struct MapIter<'coll, T: AsRef, K: Pod, V: Pod> { inner: MapKeys<'coll, T, K, V>, } -impl<'coll, T: AsRef, K: Clone + Pod, V: Clone + Pod> MapIter<'coll, T, K, V> { +impl<'coll, T: AsRef, K: Pod, V: Pod> MapIter<'coll, T, K, V> { fn new(map: &'coll HashMap) -> MapIter<'coll, T, K, V> { MapIter { inner: MapKeys::new(map), @@ -159,7 +159,7 @@ impl<'coll, T: AsRef, K: Clone + Pod, V: Clone + Pod> MapIter<'coll, T, K, } } -impl, K: Clone + Pod, V: Clone + Pod> Iterator for MapIter<'_, T, K, V> { +impl, K: Pod, V: Pod> Iterator for MapIter<'_, T, K, V> { type Item = Result<(K, V), MapError>; fn next(&mut self) -> Option {