mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'tygyh/Resolve-all-'#-allow(clippy--clone_on_copy)]'-error-supressions' into 'master'
Resolve all '#[allow(clippy::clone_on_copy)]' error supressions See merge request veloren/veloren!2623
This commit is contained in:
commit
d44702ef20
@ -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) }
|
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> {
|
pub fn map<U: Default>(self, mut f: impl FnMut(K, T) -> U) -> MapVec<K, U> {
|
||||||
MapVec {
|
MapVec {
|
||||||
entries: self
|
entries: self
|
||||||
.entries
|
.entries
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(s, v)| (s.clone(), f(s, v)))
|
.map(|(s, v)| (s, f(s, v)))
|
||||||
.collect(),
|
.collect(),
|
||||||
default: U::default(),
|
default: U::default(),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user