Skip to content

Commit 81c47d5

Browse files
authored
Update map.rs
1 parent 6c4616c commit 81c47d5

File tree

1 file changed

+6
-4
lines changed
  • src/libstd/collections/hash

1 file changed

+6
-4
lines changed

src/libstd/collections/hash/map.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -335,16 +335,18 @@ fn test_resize_policy() {
335335
/// println!("{:?} has {} hp", viking, health);
336336
/// }
337337
/// ```
338+
///
338339
/// A HashMap with fixed list of elements can be initialized from an array:
340+
///
339341
/// ```
340342
/// use std::collections::HashMap;
341343
///
342344
/// fn main() {
343345
/// let timber_resources: HashMap<&str, i32> =
344-
/// [ ("Norway", 100),
345-
/// ("Denmark", 50),
346-
/// ("Iceland", 10) ]
347-
/// .iter().cloned().collect();
346+
/// [("Norway", 100),
347+
/// ("Denmark", 50),
348+
/// ("Iceland", 10)]
349+
/// .iter().cloned().collect();
348350
/// // use the values stored in map
349351
/// }
350352
/// ```

0 commit comments

Comments
 (0)