mirror of
https://github.com/rust-lang/rust
synced 2024-10-19 06:54:02 +00:00
Rollup merge of #94826 - allgoewer:fix-retain-documentation, r=yaahc
Improve doc wording for retain on some collections I found the documentation wording on the various retain methods on many collections to be unusual. I tried to invert the relation by switching `such that` with `for which` .
This commit is contained in:
commit
f97a1c6909
|
@ -779,7 +779,7 @@ pub fn drain_sorted(&mut self) -> DrainSorted<'_, T> {
|
|||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all elements `e` such that `f(&e)` returns
|
||||
/// In other words, remove all elements `e` for which `f(&e)` returns
|
||||
/// `false`. The elements are visited in unsorted (and unspecified) order.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
|
@ -963,7 +963,7 @@ pub fn remove_entry<Q: ?Sized>(&mut self, key: &Q) -> Option<(K, V)>
|
|||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`.
|
||||
/// In other words, remove all pairs `(k, v)` for which `f(&k, &mut v)` returns `false`.
|
||||
/// The elements are visited in ascending key order.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
|
@ -873,7 +873,7 @@ pub fn take<Q: ?Sized>(&mut self, value: &Q) -> Option<T>
|
|||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all elements `e` such that `f(&e)` returns `false`.
|
||||
/// In other words, remove all elements `e` for which `f(&e)` returns `false`.
|
||||
/// The elements are visited in ascending order.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
|
@ -2119,7 +2119,7 @@ pub fn append(&mut self, other: &mut Self) {
|
|||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all elements `e` such that `f(&e)` returns false.
|
||||
/// In other words, remove all elements `e` for which `f(&e)` returns false.
|
||||
/// This method operates in place, visiting each element exactly once in the
|
||||
/// original order, and preserves the order of the retained elements.
|
||||
///
|
||||
|
@ -2158,7 +2158,7 @@ pub fn retain<F>(&mut self, mut f: F)
|
|||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all elements `e` such that `f(&e)` returns false.
|
||||
/// In other words, remove all elements `e` for which `f(&e)` returns false.
|
||||
/// This method operates in place, visiting each element exactly once in the
|
||||
/// original order, and preserves the order of the retained elements.
|
||||
///
|
||||
|
|
|
@ -1424,7 +1424,7 @@ fn assert_failed(index: usize, len: usize) -> ! {
|
|||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all elements `e` such that `f(&e)` returns `false`.
|
||||
/// In other words, remove all elements `e` for which `f(&e)` returns `false`.
|
||||
/// This method operates in place, visiting each element exactly once in the
|
||||
/// original order, and preserves the order of the retained elements.
|
||||
///
|
||||
|
|
|
@ -621,7 +621,7 @@ pub fn drain_filter<F>(&mut self, pred: F) -> DrainFilter<'_, K, V, F>
|
|||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`.
|
||||
/// In other words, remove all pairs `(k, v)` for which `f(&k, &mut v)` returns `false`.
|
||||
/// The elements are visited in unsorted (and unspecified) order.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
|
@ -300,7 +300,7 @@ pub fn drain_filter<F>(&mut self, pred: F) -> DrainFilter<'_, T, F>
|
|||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all elements `e` such that `f(&e)` returns `false`.
|
||||
/// In other words, remove all elements `e` for which `f(&e)` returns `false`.
|
||||
/// The elements are visited in unsorted (and unspecified) order.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
Loading…
Reference in a new issue