about summary refs log tree commit diff
path: root/src/libstd/collections
diff options
context:
space:
mode:
authorFrank Rehberger <frehberg@gmail.com>2016-09-26 16:03:37 +0200
committerGitHub <noreply@github.com>2016-09-26 16:03:37 +0200
commit35510080220fc4f586075dd483ae1bbb67503c44 (patch)
treebfafe90aec2b637c0b06836559c477f17cddf9c9 /src/libstd/collections
parentbd80e7bce77aae5a7d515a1113ae3a471d4ce6e2 (diff)
downloadrust-35510080220fc4f586075dd483ae1bbb67503c44.tar.gz
rust-35510080220fc4f586075dd483ae1bbb67503c44.zip
Update set.rs
Diffstat (limited to 'src/libstd/collections')
-rw-r--r--src/libstd/collections/hash/set.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs
index 568163b77de..572e333def4 100644
--- a/src/libstd/collections/hash/set.rs
+++ b/src/libstd/collections/hash/set.rs
@@ -106,12 +106,10 @@ const INITIAL_CAPACITY: usize = 32;
 ///
 /// fn main() {
 ///     let viking_names: HashSet<&str> =
-///         [ "Einar", "Olaf", "Harald" ].iter().map(|&x| x).collect();
-///     // use the values store in the set
+///         [ "Einar", "Olaf", "Harald" ].iter().cloned().collect();
+///     // use the values stored in the set
 /// }
 /// ```
-/// This works for Copy types, if you want to cover non-copy types then you need to replace 
-/// the map(|&x| x) with map(|x| x.clone())
 
 
 #[derive(Clone)]