Fix clippy::perf lint errors

This commit is contained in:
J Henry Waugh
2020-09-20 13:07:43 -05:00
parent 788a22108b
commit c8dffff515
3 changed files with 4 additions and 6 deletions

View File

@@ -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);
});
}