diff options
| author | Paul Mabileau <paul.mabileau@harfanglab.fr> | 2025-05-17 02:45:56 +0200 |
|---|---|---|
| committer | Paul Mabileau <paul.mabileau@harfanglab.fr> | 2025-05-17 02:45:56 +0200 |
| commit | 014434e96f4f42e06b6c2dfc00110209b121040e (patch) | |
| tree | 624de4a4aec5f586d13ac7852c77614529c9ed7a /library/alloc | |
| parent | 9205ee27a815e5b356cfce6269d9ded1d1c098f7 (diff) | |
Docs(lib/extract_if): Unify paragraph about elements mutation
Take the one from `BTreeMap` that seems the best-worded and most precise among the available variations. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/collections/linked_list.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/library/alloc/src/collections/linked_list.rs b/library/alloc/src/collections/linked_list.rs index 1890a114d3c..0e365ebd308 100644 --- a/library/alloc/src/collections/linked_list.rs +++ b/library/alloc/src/collections/linked_list.rs @@ -1132,8 +1132,8 @@ impl<T, A: Allocator> LinkedList<T, A> { /// or the iteration short-circuits, then the remaining elements will be retained. /// Use `extract_if().for_each(drop)` if you do not need the returned iterator. /// - /// Note that `extract_if` lets you mutate every element in the filter closure, regardless of - /// whether you choose to keep or remove it. + /// The iterator also lets you mutate the value of each element in the + /// closure, regardless of whether you choose to keep or remove it. /// /// # Examples /// diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index e5f2c9468e3..3ea5f160666 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -3692,8 +3692,8 @@ impl<T, A: Allocator> Vec<T, A> { /// But `extract_if` is easier to use. `extract_if` is also more efficient, /// because it can backshift the elements of the array in bulk. /// - /// Note that `extract_if` also lets you mutate the elements passed to the filter closure, - /// regardless of whether you choose to keep or remove them. + /// The iterator also lets you mutate the value of each element in the + /// closure, regardless of whether you choose to keep or remove it. /// /// # Panics /// |
