Skip to content

Commit 86abd6c

Browse files
committed
Update drain_filter docs.
1 parent 6ea798c commit 86abd6c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,13 +584,13 @@ impl<K, V, S> HashMap<K, V, S> {
584584
}
585585
}
586586

587-
/// Drains elements which are false under the given predicate,
587+
/// Drains elements which are true under the given predicate,
588588
/// and returns an iterator over the removed items.
589589
///
590-
/// In other words, move all pairs `(k, v)` such that `f(&k,&mut v)` returns `false` out
590+
/// In other words, move all pairs `(k, v)` such that `f(&k,&mut v)` returns `true` out
591591
/// into another iterator.
592592
///
593-
/// When the returned DrainedFilter is dropped, the elements that don't satisfy
593+
/// When the returned DrainedFilter is dropped, any remaining elements that satisfy
594594
/// the predicate are dropped from the table.
595595
///
596596
/// # Examples

src/set.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,13 @@ impl<T, S> HashSet<T, S> {
352352
self.map.retain(|k, _| f(k));
353353
}
354354

355-
/// Drains elements which are false under the given predicate,
355+
/// Drains elements which are true under the given predicate,
356356
/// and returns an iterator over the removed items.
357357
///
358-
/// In other words, move all elements `e` such that `f(&e)` returns `false` out
358+
/// In other words, move all elements `e` such that `f(&e)` returns `true` out
359359
/// into another iterator.
360360
///
361-
/// When the returned DrainedFilter is dropped, the elements that don't satisfy
361+
/// When the returned DrainedFilter is dropped, any remaining elements that satisfy
362362
/// the predicate are dropped from the set.
363363
///
364364
/// # Examples

0 commit comments

Comments
 (0)