Macro medea::hashmap[][src]

macro_rules! hashmap {
    (@single $($x:tt)*) => { ... };
    (@count $($rest:expr),*) => { ... };
    ($($key:expr => $value:expr,)+) => { ... };
    ($($key:expr => $value:expr),*) => { ... };
}

Creates new HashMap from a list of key-value pairs.

Example

let map = hashmap! {
    "a" => 1,
    "b" => 2,
};
assert_eq!(map["a"], 1);
assert_eq!(map["b"], 2);
assert_eq!(map.get("c"), None);