Macro linear_map::linear_map [] [src]

macro_rules! linear_map {
    ($($key:expr => $value:expr,)+) => { ... };
    ($($key:expr => $value:expr),*) => { ... };
}

Creates a LinearMap from a list of key-value pairs.

The created LinearMap has a capacity set to the number of entries provided.

Example

#[macro_use] extern crate linear_map;

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