map! macro Rust crate
This crate provides map! macros to create map collections and
insert key-value pairs. This is inspired by the vec! macro.
map! macro
Create a new map collection and insert key-value pairs.
Example with tuple syntax:
let m = map!;
Example with arrow syntax:
let m = map!;
Example with multiple lines and tuple syntax:
let m = map!;
Example with multiple lines and arrow syntax:
let m = map!;
Equivalent Rust standard code:
let mut m = new;
m.insert;
m.insert;
map_insert! macro
Use an existing map collection and insert key-value pairs.
Example with tuple syntax:
let mut m = new;
map_insert!;
Example with arrow syntax:
let mut m = new;
map_insert!;
Example with multiple lines and tuple syntax:
let mut m = new;
map_insert!;
Example with multiple lines and arrow syntax:
let mut m = new;
map_insert!;
Equivalent Rust std code with method `insert``:
let mut m = new;
m.insert;
m.insert;