diff --git a/src/libcollections/hashmap.rs b/src/libcollections/hashmap.rs index 35a89fe5dc5de..87dc97d70c7a5 100644 --- a/src/libcollections/hashmap.rs +++ b/src/libcollections/hashmap.rs @@ -1299,9 +1299,10 @@ impl, V, S, H: Hasher> HashMap { /// ); /// } /// - /// for (k, v) in map.iter() { - /// println!("{} -> {}", *k, *v); - /// } + /// assert_eq!(map.len(), 3); + /// assert_eq!(map.get(&"a key"), &vec!["value", "new value"]); + /// assert_eq!(map.get(&"b key"), &vec!["new value"]); + /// assert_eq!(map.get(&"z key"), &vec!["new value", "value"]); /// ``` pub fn find_with_or_insert_with<'a, A>(&'a mut self, k: K,