]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/collections/mod.rs
std: Clean out deprecated APIs
[rust.git] / src / libstd / collections / mod.rs
index 417261cf4c304a3073aa624c773692b302e6ac1b..4de442fd3a19955a1b23894ca6ab43b39035e4e7 100644 (file)
 //! }
 //!
 //! let mut map = BTreeMap::new();
-//! map.insert(Foo { a: 1, b: "baz" }, ());
+//! map.insert(Foo { a: 1, b: "baz" }, 99);
 //!
 //! // We already have a Foo with an a of 1, so this will be updating the value.
-//! map.insert(Foo { a: 1, b: "xyz" }, ());
+//! map.insert(Foo { a: 1, b: "xyz" }, 100);
 //!
-//! // ... but the key hasn't changed. b is still "baz", not "xyz"
+//! // The value has been updated...
+//! assert_eq!(map.values().next().unwrap(), &100);
+//!
+//! // ...but the key hasn't changed. b is still "baz", not "xyz".
 //! assert_eq!(map.keys().next().unwrap().b, "baz");
 //! ```
 
@@ -439,13 +442,3 @@ pub mod hash_set {
     #[stable(feature = "rust1", since = "1.0.0")]
     pub use super::hash::set::*;
 }
-
-/// Experimental support for providing custom hash algorithms to a HashMap and
-/// HashSet.
-#[unstable(feature = "hashmap_hasher", reason = "module was recently added",
-           issue = "27713")]
-#[rustc_deprecated(since = "1.7.0", reason = "support moved to std::hash")]
-#[allow(deprecated)]
-pub mod hash_state {
-    pub use super::hash::state::*;
-}