about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-25 07:37:05 +0000
committerbors <bors@rust-lang.org>2025-05-25 07:37:05 +0000
commitaa57e46e24a4a08cc336325e92567b40b0c2ba62 (patch)
treead91cc843609eb47f88ab937a3620dc025572a93 /library/std/src
parent3d86494a0d0131c32eb15e3a4b685707b9ff000d (diff)
parentc27b7c22148e1666633d6a19826c37fcece07569 (diff)
downloadrust-aa57e46e24a4a08cc336325e92567b40b0c2ba62.tar.gz
rust-aa57e46e24a4a08cc336325e92567b40b0c2ba62.zip
Auto merge of #141529 - jhpratt:rollup-8dle839, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#139831 (rustdoc: on mobile, make the sidebar full width and linewrap)
 - rust-lang/rust#140950 (More option optimization tests)
 - rust-lang/rust#141108 (Docs(lib): Fix `extract_if` docs)
 - rust-lang/rust#141361 (use `cfg_select!` to select the right `VaListImpl` definition)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/collections/hash/map.rs12
-rw-r--r--library/std/src/collections/hash/set.rs8
2 files changed, 10 insertions, 10 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs
index 3530f890f52..edbdd041145 100644
--- a/library/std/src/collections/hash/map.rs
+++ b/library/std/src/collections/hash/map.rs
@@ -648,14 +648,14 @@ impl<K, V, S> HashMap<K, V, S> {
         Drain { base: self.base.drain() }
     }
 
-    /// Creates an iterator which uses a closure to determine if an element should be removed.
+    /// Creates an iterator which uses a closure to determine if an element (key-value pair) should be removed.
     ///
-    /// If the closure returns true, the element is removed from the map and yielded.
-    /// If the closure returns false, or panics, the element remains in the map and will not be
-    /// yielded.
+    /// If the closure returns `true`, the element is removed from the map and
+    /// yielded. If the closure returns `false`, or panics, the element remains
+    /// in the map and will not be yielded.
     ///
-    /// Note that `extract_if` lets you mutate every value 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.
     ///
     /// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating
     /// or the iteration short-circuits, then the remaining elements will be retained.
diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs
index 8514dfd9a98..482d57b47f6 100644
--- a/library/std/src/collections/hash/set.rs
+++ b/library/std/src/collections/hash/set.rs
@@ -276,11 +276,11 @@ impl<T, S> HashSet<T, S> {
         Drain { base: self.base.drain() }
     }
 
-    /// Creates an iterator which uses a closure to determine if a value should be removed.
+    /// Creates an iterator which uses a closure to determine if an element should be removed.
     ///
-    /// If the closure returns true, then the value is removed and yielded.
-    /// If the closure returns false, the value will remain in the list and will not be yielded
-    /// by the iterator.
+    /// If the closure returns `true`, the element is removed from the set and
+    /// yielded. If the closure returns `false`, or panics, the element remains
+    /// in the set and will not be yielded.
     ///
     /// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating
     /// or the iteration short-circuits, then the remaining elements will be retained.