Macro message_locator::locator_vars
source · [−]macro_rules! locator_vars {
(@single $($x:tt)*) => { ... };
(@count $($rest:expr),*) => { ... };
($($key:expr => $value:expr,)+) => { ... };
($($key:expr => $value:expr),*) => { ... };
}
Expand description
Creates a HashMap<String, String>
from a list of key-value pairs.
Example
use message_locator::locator_vars;
fn main() {
let map = locator_vars!{
"a" => "foo",
"b" => "bar",
};
assert_eq!(map[&"a".to_string()], "foo");
assert_eq!(map[&"b".to_string()], "bar");
assert_eq!(map.get(&"c".to_string()), None);
}