]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/collections/hash/map.rs
Future-proof indexing on maps: remove IndexMut
[rust.git] / src / libstd / collections / hash / map.rs
index 60b1738d2c98918351082c0da31efbfc78b08aed..9139e182ce479594ba38b0ccc132a33f2f9b98a5 100644 (file)
@@ -23,7 +23,7 @@
 use iter::{self, Iterator, ExactSizeIterator, IntoIterator, IteratorExt, FromIterator, Extend, Map};
 use marker::Sized;
 use mem::{self, replace};
-use ops::{Deref, FnMut, Index, IndexMut};
+use ops::{Deref, FnMut, Index};
 use option::Option::{self, Some, None};
 use rand::{self, Rng};
 use result::Result::{self, Ok, Err};
@@ -1258,18 +1258,6 @@ fn index<'a>(&'a self, index: &Q) -> &'a V {
     }
 }
 
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<K, V, S, Q: ?Sized> IndexMut<Q> for HashMap<K, V, S>
-    where K: Eq + Hash + Borrow<Q>,
-          Q: Eq + Hash,
-          S: HashState,
-{
-    #[inline]
-    fn index_mut<'a>(&'a mut self, index: &Q) -> &'a mut V {
-        self.get_mut(index).expect("no entry found for key")
-    }
-}
-
 /// HashMap iterator.
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Iter<'a, K: 'a, V: 'a> {