Skip to content

Commit 229e01d

Browse files
committedMar 10, 2022
Improve doc wording for retain on some collections
1 parent 5f4e067 commit 229e01d

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed
 

‎library/alloc/src/collections/binary_heap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ impl<T: Ord> BinaryHeap<T> {
779779

780780
/// Retains only the elements specified by the predicate.
781781
///
782-
/// In other words, remove all elements `e` such that `f(&e)` returns
782+
/// In other words, remove all elements `e` for which `f(&e)` returns
783783
/// `false`. The elements are visited in unsorted (and unspecified) order.
784784
///
785785
/// # Examples

‎library/alloc/src/collections/btree/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ impl<K, V> BTreeMap<K, V> {
963963

964964
/// Retains only the elements specified by the predicate.
965965
///
966-
/// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`.
966+
/// In other words, remove all pairs `(k, v)` for which `f(&k, &mut v)` returns `false`.
967967
/// The elements are visited in ascending key order.
968968
///
969969
/// # Examples

‎library/alloc/src/collections/btree/set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ impl<T> BTreeSet<T> {
873873

874874
/// Retains only the elements specified by the predicate.
875875
///
876-
/// In other words, remove all elements `e` such that `f(&e)` returns `false`.
876+
/// In other words, remove all elements `e` for which `f(&e)` returns `false`.
877877
/// The elements are visited in ascending order.
878878
///
879879
/// # Examples

‎library/alloc/src/collections/vec_deque/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
21192119

21202120
/// Retains only the elements specified by the predicate.
21212121
///
2122-
/// In other words, remove all elements `e` such that `f(&e)` returns false.
2122+
/// In other words, remove all elements `e` for which `f(&e)` returns false.
21232123
/// This method operates in place, visiting each element exactly once in the
21242124
/// original order, and preserves the order of the retained elements.
21252125
///
@@ -2158,7 +2158,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
21582158

21592159
/// Retains only the elements specified by the predicate.
21602160
///
2161-
/// In other words, remove all elements `e` such that `f(&e)` returns false.
2161+
/// In other words, remove all elements `e` for which `f(&e)` returns false.
21622162
/// This method operates in place, visiting each element exactly once in the
21632163
/// original order, and preserves the order of the retained elements.
21642164
///

‎library/alloc/src/vec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ impl<T, A: Allocator> Vec<T, A> {
14241424

14251425
/// Retains only the elements specified by the predicate.
14261426
///
1427-
/// In other words, remove all elements `e` such that `f(&e)` returns `false`.
1427+
/// In other words, remove all elements `e` for which `f(&e)` returns `false`.
14281428
/// This method operates in place, visiting each element exactly once in the
14291429
/// original order, and preserves the order of the retained elements.
14301430
///

‎library/std/src/collections/hash/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ impl<K, V, S> HashMap<K, V, S> {
621621

622622
/// Retains only the elements specified by the predicate.
623623
///
624-
/// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`.
624+
/// In other words, remove all pairs `(k, v)` for which `f(&k, &mut v)` returns `false`.
625625
/// The elements are visited in unsorted (and unspecified) order.
626626
///
627627
/// # Examples

‎library/std/src/collections/hash/set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ impl<T, S> HashSet<T, S> {
300300

301301
/// Retains only the elements specified by the predicate.
302302
///
303-
/// In other words, remove all elements `e` such that `f(&e)` returns `false`.
303+
/// In other words, remove all elements `e` for which `f(&e)` returns `false`.
304304
/// The elements are visited in unsorted (and unspecified) order.
305305
///
306306
/// # Examples

0 commit comments

Comments
 (0)
Please sign in to comment.