We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd80e7b commit 3551008Copy full SHA for 3551008
src/libstd/collections/hash/set.rs
@@ -106,12 +106,10 @@ const INITIAL_CAPACITY: usize = 32;
106
///
107
/// fn main() {
108
/// let viking_names: HashSet<&str> =
109
-/// [ "Einar", "Olaf", "Harald" ].iter().map(|&x| x).collect();
110
-/// // use the values store in the set
+/// [ "Einar", "Olaf", "Harald" ].iter().cloned().collect();
+/// // use the values stored in the set
111
/// }
112
/// ```
113
-/// This works for Copy types, if you want to cover non-copy types then you need to replace
114
-/// the map(|&x| x) with map(|x| x.clone())
115
116
117
#[derive(Clone)]
0 commit comments