macro_rules! map {
{ $($key:expr => $value:expr),+, } => { ... };
{ $($key:expr => $value:expr),+ } => { ... };
}
Expand description
Create a hashmap with the given key/value pairs.
use {
qol::{map, S},
std::collections::HashMap,
};
let _nums: HashMap<i32, String> = map! {
1 => S!("one"),
2 => S!("two"),
3 => S!("three"),
4 => S!("four"),
5 => S!("five"),
6 => S!("six")
};