Skip to content

Commit 24d0480

Browse files
authored
Merge pull request #616 from dtolnay-contrib/extractif
Drop FnMut trait bounds from ExtractIf data structures
2 parents 8abce3e + 82cd86c commit 24d0480

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

src/map.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,10 +2596,7 @@ impl<K, V, A: Allocator> Drain<'_, K, V, A> {
25962596
/// assert_eq!(map.len(), 1);
25972597
/// ```
25982598
#[must_use = "Iterators are lazy unless consumed"]
2599-
pub struct ExtractIf<'a, K, V, F, A: Allocator = Global>
2600-
where
2601-
F: FnMut(&K, &mut V) -> bool,
2602-
{
2599+
pub struct ExtractIf<'a, K, V, F, A: Allocator = Global> {
26032600
f: F,
26042601
inner: RawExtractIf<'a, (K, V), A>,
26052602
}

src/set.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,10 +1678,7 @@ pub struct Drain<'a, K, A: Allocator = Global> {
16781678
/// [`extract_if`]: struct.HashSet.html#method.extract_if
16791679
/// [`HashSet`]: struct.HashSet.html
16801680
#[must_use = "Iterators are lazy unless consumed"]
1681-
pub struct ExtractIf<'a, K, F, A: Allocator = Global>
1682-
where
1683-
F: FnMut(&K) -> bool,
1684-
{
1681+
pub struct ExtractIf<'a, K, F, A: Allocator = Global> {
16851682
f: F,
16861683
inner: RawExtractIf<'a, (K, ()), A>,
16871684
}

src/table.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,10 +2343,7 @@ impl<T: fmt::Debug, A: Allocator> fmt::Debug for Drain<'_, T, A> {
23432343
/// This `struct` is created by [`HashTable::extract_if`]. See its
23442344
/// documentation for more.
23452345
#[must_use = "Iterators are lazy unless consumed"]
2346-
pub struct ExtractIf<'a, T, F, A: Allocator = Global>
2347-
where
2348-
F: FnMut(&mut T) -> bool,
2349-
{
2346+
pub struct ExtractIf<'a, T, F, A: Allocator = Global> {
23502347
f: F,
23512348
inner: RawExtractIf<'a, T, A>,
23522349
}

0 commit comments

Comments
 (0)