[][src]Macro brawl_api::map_build

macro_rules! map_build {
    ($initializer:expr; $($key:expr => $val:expr),*) => { ... };
}

Constructs any Map<Key, Value> type, based on an initializer expression.

Examples

This example is not tested
let custom_map = map_build!{
    MyMap::new();
    "key" => "val",
    "other_key" => value,
    key => "val",
}

// Expands to

let custom_map = MyMap::new();
custom_map.insert("key", "val");
custom_map.insert("other_key", value);
custom_map.insert(key, "val");