We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1254af4 commit b0942d6Copy full SHA for b0942d6
src/group_map.rs
@@ -13,10 +13,10 @@ where
13
I: Iterator<Item = (K, V)>,
14
K: Hash + Eq,
15
{
16
- let mut lookup = HashMap::new();
+ let mut lookup = HashMap::<K, Vec<V>>::new();
17
18
iter.for_each(|(key, val)| {
19
- lookup.entry(key).or_insert_with(Vec::new).push(val);
+ lookup.entry(key).or_default().push(val);
20
});
21
22
lookup
0 commit comments