Macro map_macro::hash_map_e
source · macro_rules! hash_map_e { {$($k: expr => $v: expr),* $(,)?} => { ... }; }
Available on crate feature
std
only.Expand description
Explicitly typed equivalent of hash_map!
.
See the explicity typed macros section.
§Examples
use std::collections::HashMap;
use std::fmt::Debug;
use map_macro::hash_map_e;
let goodbye: HashMap<&str, &dyn Debug> = hash_map_e! {
"en" => &"Goodbye",
"de" => &"Auf Wiedersehen",
"fr" => &"Au revoir",
"es" => &"Adios",
"cat" => &"Adéu",
};
println!("{:?}", goodbye);