Skip to content

Commit aa57e46

Browse files
committed
Auto merge of #141529 - jhpratt:rollup-8dle839, r=jhpratt
Rollup of 4 pull requests Successful merges: - #139831 (rustdoc: on mobile, make the sidebar full width and linewrap) - #140950 (More option optimization tests) - #141108 (Docs(lib): Fix `extract_if` docs) - #141361 (use `cfg_select!` to select the right `VaListImpl` definition) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3d86494 + c27b7c2 commit aa57e46

File tree

13 files changed

+229
-232
lines changed

13 files changed

+229
-232
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,10 +1398,12 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
13981398
}
13991399

14001400
/// Creates an iterator that visits all elements (key-value pairs) in
1401-
/// ascending key order and uses a closure to determine if an element should
1402-
/// be removed. If the closure returns `true`, the element is removed from
1403-
/// the map and yielded. If the closure returns `false`, or panics, the
1404-
/// element remains in the map and will not be yielded.
1401+
/// ascending key order and uses a closure to determine if an element
1402+
/// should be removed.
1403+
///
1404+
/// If the closure returns `true`, the element is removed from the map and
1405+
/// yielded. If the closure returns `false`, or panics, the element remains
1406+
/// in the map and will not be yielded.
14051407
///
14061408
/// The iterator also lets you mutate the value of each element in the
14071409
/// closure, regardless of whether you choose to keep or remove it.

library/alloc/src/collections/linked_list.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,20 +1124,20 @@ impl<T, A: Allocator> LinkedList<T, A> {
11241124

11251125
/// Creates an iterator which uses a closure to determine if an element should be removed.
11261126
///
1127-
/// If the closure returns true, then the element is removed and yielded.
1128-
/// If the closure returns false, the element will remain in the list and will not be yielded
1129-
/// by the iterator.
1127+
/// If the closure returns `true`, the element is removed from the list and
1128+
/// yielded. If the closure returns `false`, or panics, the element remains
1129+
/// in the list and will not be yielded.
11301130
///
11311131
/// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating
11321132
/// or the iteration short-circuits, then the remaining elements will be retained.
11331133
/// Use `extract_if().for_each(drop)` if you do not need the returned iterator.
11341134
///
1135-
/// Note that `extract_if` lets you mutate every element in the filter closure, regardless of
1136-
/// whether you choose to keep or remove it.
1135+
/// The iterator also lets you mutate the value of each element in the
1136+
/// closure, regardless of whether you choose to keep or remove it.
11371137
///
11381138
/// # Examples
11391139
///
1140-
/// Splitting a list into evens and odds, reusing the original list:
1140+
/// Splitting a list into even and odd values, reusing the original list:
11411141
///
11421142
/// ```
11431143
/// use std::collections::LinkedList;

library/alloc/src/vec/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3648,11 +3648,11 @@ impl<T, A: Allocator> Vec<T, A> {
36483648
Splice { drain: self.drain(range), replace_with: replace_with.into_iter() }
36493649
}
36503650

3651-
/// Creates an iterator which uses a closure to determine if element in the range should be removed.
3651+
/// Creates an iterator which uses a closure to determine if an element in the range should be removed.
36523652
///
3653-
/// If the closure returns true, then the element is removed and yielded.
3654-
/// If the closure returns false, the element will remain in the vector and will not be yielded
3655-
/// by the iterator.
3653+
/// If the closure returns `true`, the element is removed from the vector
3654+
/// and yielded. If the closure returns `false`, or panics, the element
3655+
/// remains in the vector and will not be yielded.
36563656
///
36573657
/// Only elements that fall in the provided range are considered for extraction, but any elements
36583658
/// after the range will still have to be moved if any element has been extracted.
@@ -3692,16 +3692,16 @@ impl<T, A: Allocator> Vec<T, A> {
36923692
/// But `extract_if` is easier to use. `extract_if` is also more efficient,
36933693
/// because it can backshift the elements of the array in bulk.
36943694
///
3695-
/// Note that `extract_if` also lets you mutate the elements passed to the filter closure,
3696-
/// regardless of whether you choose to keep or remove them.
3695+
/// The iterator also lets you mutate the value of each element in the
3696+
/// closure, regardless of whether you choose to keep or remove it.
36973697
///
36983698
/// # Panics
36993699
///
37003700
/// If `range` is out of bounds.
37013701
///
37023702
/// # Examples
37033703
///
3704-
/// Splitting an array into evens and odds, reusing the original allocation:
3704+
/// Splitting a vector into even and odd values, reusing the original vector:
37053705
///
37063706
/// ```
37073707
/// let mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15];

0 commit comments

Comments
 (0)