macro_rules! btreemap {
() => { ... };
($($key:expr => $value:expr,)+) => { ... };
($($key:expr => $value:expr),*) => { ... };
}Expand description
Generates the code to initialize a BTreeMap.
The macro can be followed by parentheses or square brackets.
ยงExample
let days = btreemap![0 => "Monday", 1 => "Tuesday", 2 => "Wednesday"];
// => BTreeMap::from([(0, "Monday"), (1, "Tuesday"), (2, "Wednesday"), ])
assert_eq!(days, BTreeMap::from([(0, "Monday"), (1, "Tuesday"), (2, "Wednesday")]));