4 ms·
Would a macro work ok for you, like the inbuilt vec! one? There's a crate for that named maplit: https://docs.rs/maplit https://docs.rs/maplit let map = ha
by dmit 7y ago
Would a macro work ok for you, like the inbuilt vec! one? There's a crate for that named maplit: https://docs.rs/maplit https://docs.rs/maplit
let map = hashmap!{
"a" => 1,
"b" => 2,
};
- gameswithgo 7y agoone of the fun things about Rust, is any time you think "man I wish there was some syntax to do this thing in Rust" you can make a macro to make it reality, usually one already exists.