Skip to content

Commit bd80e7b

Browse files
authored
Update map.rs
1 parent aed99c8 commit bd80e7b

File tree

1 file changed

+2
-5
lines changed
  • src/libstd/collections/hash

1 file changed

+2
-5
lines changed

src/libstd/collections/hash/map.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,10 @@ fn test_resize_policy() {
344344
/// [ ("Norway", 100),
345345
/// ("Denmark", 50),
346346
/// ("Iceland", 10) ]
347-
/// .iter().map(|&x| x).collect();
348-
/// // use the values store in map
347+
/// .iter().cloned().collect();
348+
/// // use the values stored in map
349349
/// }
350350
/// ```
351-
/// This works for Copy types, if you want to cover non-copy types then you need to replace
352-
/// the map(|&x| x) with map(|x| x.clone())
353-
354351
355352
#[derive(Clone)]
356353
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)