Resolve all '#[allow(clippy::clone_on_copy)]' error supressions

This commit is contained in:
Dr. Dystopia 2021-07-09 17:46:08 +02:00
parent 8d18c2be1f
commit beed7b81f9

View File

@ -63,13 +63,12 @@ impl<K: Copy + Eq + Hash, T: Clone> MapVec<K, T> {
pub fn get(&self, entry: K) -> &T { self.entries.get(&entry).unwrap_or(&self.default) }
#[allow(clippy::clone_on_copy)] // TODO: Pending review in #587
pub fn map<U: Default>(self, mut f: impl FnMut(K, T) -> U) -> MapVec<K, U> {
MapVec {
entries: self
.entries
.into_iter()
.map(|(s, v)| (s.clone(), f(s, v)))
.map(|(s, v)| (s, f(s, v)))
.collect(),
default: U::default(),
}