Fix clippy::perf lint errors
This commit is contained in:
@@ -46,9 +46,7 @@ mod map_functions {
|
||||
}
|
||||
pub fn fill_with(map1: &mut Map, map2: Map) {
|
||||
map2.into_iter().for_each(|(key, value)| {
|
||||
if !map1.contains_key(&key) {
|
||||
map1.insert(key, value);
|
||||
}
|
||||
map1.entry(key).or_insert(value);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user