Skip to content

Commit a7b2f9c

Browse files
committed
into_group_map: make code more idiomatic
1 parent d92a05d commit a7b2f9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/group_map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ where
1313
I: Iterator<Item = (K, V)>,
1414
K: Hash + Eq,
1515
{
16-
let mut lookup = HashMap::new();
16+
let mut lookup = HashMap::<K, Vec<V>>::new();
1717

1818
iter.for_each(|(key, val)| {
19-
lookup.entry(key).or_insert_with(Vec::new).push(val);
19+
lookup.entry(key).or_default().push(val);
2020
});
2121

2222
lookup

0 commit comments

Comments
 (0)