Skip to content

Commit 72a6974

Browse files
committed
Make HashMaps mutable again
1 parent 440cffd commit 72a6974

File tree

1 file changed

+6
-6
lines changed
  • library/std/src/collections/hash

1 file changed

+6
-6
lines changed

library/std/src/collections/hash/map.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ impl<K, V, S> HashMap<K, V, S> {
380380
/// ```
381381
/// use std::collections::HashMap;
382382
///
383-
/// let map = HashMap::from([
383+
/// let mut map = HashMap::from([
384384
/// ("a", 1),
385385
/// ("b", 2),
386386
/// ("c", 3),
@@ -431,7 +431,7 @@ impl<K, V, S> HashMap<K, V, S> {
431431
/// ```
432432
/// use std::collections::HashMap;
433433
///
434-
/// let map = HashMap::from([
434+
/// let mut map = HashMap::from([
435435
/// ("a", 1),
436436
/// ("b", 2),
437437
/// ("c", 3),
@@ -1246,7 +1246,7 @@ impl<K: Debug, V: Debug> fmt::Debug for Iter<'_, K, V> {
12461246
/// ```
12471247
/// use std::collections::HashMap;
12481248
///
1249-
/// let map = HashMap::from([
1249+
/// let mut map = HashMap::from([
12501250
/// ("a", 1),
12511251
/// ]);
12521252
/// let iter = map.iter_mut();
@@ -1383,7 +1383,7 @@ impl<K, V: Debug> fmt::Debug for Values<'_, K, V> {
13831383
/// ```
13841384
/// use std::collections::HashMap;
13851385
///
1386-
/// let map = HashMap::from([
1386+
/// let mut map = HashMap::from([
13871387
/// ("a", 1),
13881388
/// ]);
13891389
/// let iter = map.drain();
@@ -1414,7 +1414,7 @@ impl<'a, K, V> Drain<'a, K, V> {
14141414
///
14151415
/// use std::collections::HashMap;
14161416
///
1417-
/// let map = HashMap::from([
1417+
/// let mut map = HashMap::from([
14181418
/// ("a", 1),
14191419
/// ]);
14201420
/// let iter = map.drain_filter(|_k, v| *v % 2 == 0);
@@ -1439,7 +1439,7 @@ where
14391439
/// ```
14401440
/// use std::collections::HashMap;
14411441
///
1442-
/// let map = HashMap::from([
1442+
/// let mut map = HashMap::from([
14431443
/// ("a", 1),
14441444
/// ]);
14451445
/// let iter_values = map.values_mut();

0 commit comments

Comments
 (0)