Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Ockajak committed Jul 13, 2024
1 parent 27e3afa commit e5d5b50
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/extensions/collectible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,7 @@ pub trait Collectible<Item>: IntoIterator<Item = Item> {
let mut result: HashMap<K, Item> = HashMap::with_capacity(iterator.size_hint().0);
for item in iterator {
let key = to_key(&item);
let new_value = match result.remove(&key) {
Some(value) => function(value, item),
None => item,
};
let new_value = if let Some(value) = result.remove(&key) { function(value, item) } else { item };
let _unused = result.insert(key, new_value);
}
result
Expand Down

0 comments on commit e5d5b50

Please sign in to comment.