macro_rules! direct_idmap {
($($key:expr => $value:expr),*) => { ... };
($($key:expr => $value:expr,)*) => { ... };
}Expand description
Creates an DirectIdMap from a list of key-value pairs
ยงExample
#[macro_use] extern crate idmap;
let map = direct_idmap! {
1 => "a",
25 => "b"
};
assert_eq!(map[1], "a");
assert_eq!(map[25], "b");
assert_eq!(map.get(26), None);
// 1 is the first key
assert_eq!(map.keys().next(), Some(&1));