Skip to main content

map

Macro map 

Source
macro_rules! map {
    { $($key:expr => $value:expr),+ } => { ... };
}
Expand description

A simple helper for constructing hashmaps with less verbosity.

ยงExamples

use std::collections::HashMap;

let m = map!{
    "foo" => vec![1, 2, 3],
    "bar" => vec![4, 5, 6]
};

assert_eq!(m.get("foo"), Some(&vec![1, 2, 3]));