@gcouprie ("Geoffroy Couprie") retweeted:
@mgattozzi ("Rage Against the State Machine") wrote:
I have been informed by @m_ou_se that this is going to be in the next Rust release in 9 days and it's better
HashMap::from([
(k1, v1),
(k2, v2)
]);with quote tweet:
@mgattozzi ("Rage Against the State Machine") wrote:
I just want a hash_map! macro ala vec! in std.
hash_map! {
k1 => v1,
k2 => v2,
};That expands to:
{
let mut map = HashMap::new();
map.insert(k1, v1);
map.insert(k2, v2);
map
}