Would a macro work ok for you, like the inbuilt vec! one? There's a crate for that named maplit: https://docs.rs/maplit
let map = hashmap!{
"a" => 1,
"b" => 2,
};