about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorJoseph T Lyons <JosephTLyons@gmail.com>2021-12-03 00:14:55 -0500
committerJoseph T Lyons <JosephTLyons@gmail.com>2021-12-03 00:14:55 -0500
commit72a6974e455793f9dcc370cc8bdf9c055b843d39 (patch)
tree8f0e50485beb5604ace7f7900b2e35fe1c729c30 /library/std
parent440cffd551ef6040253e79e350d585cbd1471140 (diff)
downloadrust-72a6974e455793f9dcc370cc8bdf9c055b843d39.tar.gz
rust-72a6974e455793f9dcc370cc8bdf9c055b843d39.zip
Make `HashMap`s mutable again
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/collections/hash/map.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs
index c585827b9eb..fa597cfba6c 100644
--- a/library/std/src/collections/hash/map.rs
+++ b/library/std/src/collections/hash/map.rs
@@ -380,7 +380,7 @@ impl<K, V, S> HashMap<K, V, S> {
     /// ```
     /// use std::collections::HashMap;
     ///
-    /// let map = HashMap::from([
+    /// let mut map = HashMap::from([
     ///     ("a", 1),
     ///     ("b", 2),
     ///     ("c", 3),
@@ -431,7 +431,7 @@ impl<K, V, S> HashMap<K, V, S> {
     /// ```
     /// use std::collections::HashMap;
     ///
-    /// let map = HashMap::from([
+    /// let mut map = HashMap::from([
     ///     ("a", 1),
     ///     ("b", 2),
     ///     ("c", 3),
@@ -1246,7 +1246,7 @@ impl<K: Debug, V: Debug> fmt::Debug for Iter<'_, K, V> {
 /// ```
 /// use std::collections::HashMap;
 ///
-/// let map = HashMap::from([
+/// let mut map = HashMap::from([
 ///     ("a", 1),
 /// ]);
 /// let iter = map.iter_mut();
@@ -1383,7 +1383,7 @@ impl<K, V: Debug> fmt::Debug for Values<'_, K, V> {
 /// ```
 /// use std::collections::HashMap;
 ///
-/// let map = HashMap::from([
+/// let mut map = HashMap::from([
 ///     ("a", 1),
 /// ]);
 /// let iter = map.drain();
@@ -1414,7 +1414,7 @@ impl<'a, K, V> Drain<'a, K, V> {
 ///
 /// use std::collections::HashMap;
 ///
-/// let map = HashMap::from([
+/// let mut map = HashMap::from([
 ///     ("a", 1),
 /// ]);
 /// let iter = map.drain_filter(|_k, v| *v % 2 == 0);
@@ -1439,7 +1439,7 @@ where
 /// ```
 /// use std::collections::HashMap;
 ///
-/// let map = HashMap::from([
+/// let mut map = HashMap::from([
 ///     ("a", 1),
 /// ]);
 /// let iter_values = map.values_mut();