Can you initialize a HashMap in Rust more concisely and declaratively?
Hello everyone! I just started learning Rust and ran into a problem: I need to create a HashMap with several predefined key-value pairs. What I'm writing now looks very verbose:\n\n```rust\nuse std::collections::HashMap;\n\nlet mut scores = HashMap::new();\nscores.insert(String::from("Blue"), 10);\nscores.insert(String::from("Yellow"), 50);\nscores.insert(String::from("Red"), 25);\n```\n\nThis takes 6 lines for three pairs! In Python I can write `{"Blue": 10, "Yellow": 50, "Red": 25}` — in one line. In JavaScript — `{Blue: 10, Yellow: 50, Red: 25}`. But in Rust I have to write a bunch of boilerplate code.\n\nI tried using the `vec![]` macro and then `.into_iter().collect()`, but that doesn't seem quite right. Is there some built-in `hashmap!{}` macro or another way?