Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Ockajak committed Jul 18, 2024
1 parent 1fba9e6 commit 4422070
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/extensions/collectible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,7 @@ pub trait Collectible<Item>: IntoIterator<Item = Item> {
where
Self: Sized,
{
let iterator = self.into_iter();
iterator.fold(initial_value, function)
self.into_iter().fold(initial_value, function)
}

/// Creates `HashMap` of keys mapped to collections of elements according to
Expand Down
3 changes: 1 addition & 2 deletions src/extensions/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1828,8 +1828,7 @@ pub trait Map<Key, Value> {
Key: Eq + Hash + 'a,
Self: IntoIterator<Item = (Key, Value)> + FromIterator<(Key, Value)>,
{
let iterator = keys.iterator();
let removed: HashSet<&Key> = HashSet::from_iter(iterator);
let removed: HashSet<&Key> = HashSet::from_iter(keys.iterator());
self.into_iter().filter(|x| !removed.contains(&x.0)).chain(replacement).collect()
}

Expand Down

0 comments on commit 4422070

Please sign in to comment.