Skip to content

Drop FnMut trait bounds from ExtractIf data structures #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2596,10 +2596,7 @@ impl<K, V, A: Allocator> Drain<'_, K, V, A> {
/// assert_eq!(map.len(), 1);
/// ```
#[must_use = "Iterators are lazy unless consumed"]
pub struct ExtractIf<'a, K, V, F, A: Allocator = Global>
where
F: FnMut(&K, &mut V) -> bool,
{
pub struct ExtractIf<'a, K, V, F, A: Allocator = Global> {
f: F,
inner: RawExtractIf<'a, (K, V), A>,
}
Expand Down
5 changes: 1 addition & 4 deletions src/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1678,10 +1678,7 @@ pub struct Drain<'a, K, A: Allocator = Global> {
/// [`extract_if`]: struct.HashSet.html#method.extract_if
/// [`HashSet`]: struct.HashSet.html
#[must_use = "Iterators are lazy unless consumed"]
pub struct ExtractIf<'a, K, F, A: Allocator = Global>
where
F: FnMut(&K) -> bool,
{
pub struct ExtractIf<'a, K, F, A: Allocator = Global> {
f: F,
inner: RawExtractIf<'a, (K, ()), A>,
}
Expand Down
5 changes: 1 addition & 4 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2343,10 +2343,7 @@ impl<T: fmt::Debug, A: Allocator> fmt::Debug for Drain<'_, T, A> {
/// This `struct` is created by [`HashTable::extract_if`]. See its
/// documentation for more.
#[must_use = "Iterators are lazy unless consumed"]
pub struct ExtractIf<'a, T, F, A: Allocator = Global>
where
F: FnMut(&mut T) -> bool,
{
pub struct ExtractIf<'a, T, F, A: Allocator = Global> {
f: F,
inner: RawExtractIf<'a, T, A>,
}
Expand Down