Skip to content

Commit f3642b8

Browse files
committed
Revised the examples.
Strings feel like better HashMap values than integers.
1 parent c631b75 commit f3642b8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
//! };
3131
//!
3232
//! let mut map = MultiMap::new();
33-
//! map.insert("One", ThingIndex::IndexOne, 1);
34-
//! map.insert("Two", ThingIndex::IndexTwo, 2);
33+
//! map.insert(1, ThingIndex::IndexOne, "Chicken Fried Steak");
34+
//! map.insert(2, ThingIndex::IndexTwo, "Blueberry Pancakes");
3535
//!
36-
//! assert!(*map.get_alt(&ThingIndex::IndexOne).unwrap() == 1);
37-
//! assert!(*map.get(&"Two").unwrap() == 2);
38-
//! assert!(map.remove_alt(&ThingIndex::IndexTwo).unwrap() == 2);
36+
//! assert!(*map.get_alt(&ThingIndex::IndexOne).unwrap() == "Chicken Fried Steak");
37+
//! assert!(*map.get(&2).unwrap() == "Blueberry Pancakes");
38+
//! assert!(map.remove_alt(&ThingIndex::IndexTwo).unwrap() == "Blueberry Pancakes");
3939
//! # }
4040
//! ```
4141
@@ -203,12 +203,12 @@ impl<K1: Eq + Hash + Debug, K2: Eq + Hash + Debug, V: Debug> fmt::Debug for Mult
203203
/// };
204204
///
205205
/// let map = multimap!{
206-
/// "One", ThingIndex::IndexOne => 1,
207-
/// "Two", ThingIndex::IndexTwo => 2,
206+
/// 1, ThingIndex::IndexOne => "Chicken Fried Steak",
207+
/// 2, ThingIndex::IndexTwo => "Blueberry Pancakes",
208208
/// };
209209
///
210-
/// assert!(*map.get_alt(&ThingIndex::IndexOne).unwrap() == 1);
211-
/// assert!(*map.get(&"Two").unwrap() == 2);
210+
/// assert!(*map.get_alt(&ThingIndex::IndexOne).unwrap() == "Chicken Fried Steak");
211+
/// assert!(*map.get(&2).unwrap() == "Blueberry Pancakes");
212212
/// # }
213213
/// ```
214214
macro_rules! multimap {

0 commit comments

Comments
 (0)