macro_rules! dict {
( $($key:tt : $val:expr),* $(,)? ) => { ... };
(@replace $_t:tt $e:expr ) => { ... };
(@count $($t:tt)*) => { ... };
}Expand description
Alias of “map!”. Create a HashMap from a list of key-value pairs
§Example
#[macro_use] extern crate maplit2;
let map = dict!{
"a": 1,
"b": 2,
};
assert_eq!(map["a"], 1);
assert_eq!(map["b"], 2);
assert_eq!(map.get("c"), None);