We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c4616c commit 81c47d5Copy full SHA for 81c47d5
src/libstd/collections/hash/map.rs
@@ -335,16 +335,18 @@ fn test_resize_policy() {
335
/// println!("{:?} has {} hp", viking, health);
336
/// }
337
/// ```
338
+///
339
/// A HashMap with fixed list of elements can be initialized from an array:
340
341
342
/// use std::collections::HashMap;
343
///
344
/// fn main() {
345
/// let timber_resources: HashMap<&str, i32> =
-/// [ ("Norway", 100),
-/// ("Denmark", 50),
346
-/// ("Iceland", 10) ]
347
-/// .iter().cloned().collect();
+/// [("Norway", 100),
+/// ("Denmark", 50),
348
+/// ("Iceland", 10)]
349
+/// .iter().cloned().collect();
350
/// // use the values stored in map
351
352
0 commit comments