Macro starlark::smallmap[][src]

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

Create a SmallMap from a list of key-value pairs.

Example

#[macro_use] extern crate starlark;

let map = smallmap!{
    "a" => 1,
    "b" => 2,
};
assert_eq!(map.get("a"), Some(&1));
assert_eq!(map.get("b"), Some(&2));
assert_eq!(map.get("c"), None);