maplit 0.1.0

Container / collection literal macros for HashMap, HashSet, BTreeMap, BTreeSet.

Macros for container literals with specific type.

extern crate maplit;

# fn main() {
let foo = hashmap!{
    "a" => 1,
    "b" => 2,
# }

The maplit crate uses => syntax for the mapping macros. It is not possible to use : as separator due to syntactic the restrictions in regular macro_rules! macros.

Generic container macros already exist elsewhere, so those are not provided here at the moment.