Macro rocket_okapi::hash_map
source · [−]macro_rules! hash_map {
($($key:expr => $val:expr),* $(,)*) => { ... };
}
Expand description
Macro to crate a HashMap
with a number of key-value pairs in it.
Examples
use std::collections::HashMap;
use rocket_okapi::hash_map;
let my_hash_map = hash_map!{
"token_name".to_owned() => "CREATURE",
"cat".to_owned() => "",
};
let mut control = HashMap::new();
control.insert("token_name".to_owned(),"CREATURE");
control.insert("cat".to_owned(),"");
assert_eq!(my_hash_map, control);