Macro collection_macros::hashmap [] [src]

macro_rules! hashmap {
    ( $($x:expr => $y:expr),* ) => { ... };
    ( $($x:expr => $y:expr,)* ) => { ... };
}

Create a HashMap containing the arguments

hashmap! allows HashMaps to be constructed using minimal syntax:

let m = hashmap!{
    "a" => "foo",
    "b" => "bar",
    "c" => "baz",
};
assert_eq!(m.get("a"), Some(&"foo"));
assert_eq!(m.get("b"), Some(&"bar"));
assert_eq!(m.get("c"), Some(&"baz"));