macro_rules! phf_map {
#[::proc_macro_hack::proc_macro_hack] => { ... };
}
Macro to create a static
(compile-time) Map
.
Requires the macros
feature.
use phf::{phf_map, Map};
static MY_MAP: Map<&'static str, u32> = phf_map! {
"hello" => 1,
"world" => 2,
};
fn main () {
assert_eq!(MY_MAP["hello"], 1);
}