macro_rules! map_string {
($($key:ident : $value:expr),* $(,)?) => { ... };
($($key:expr => $value:expr),* $(,)?) => { ... };
}
Expand description
A quick macro to generate a HashMap<String, String>
§Example 1
// The type declaration is for the example only and is not needed.
let style1: std::collections::HashMap<String, String> = rust_fetch::map_string!{item1 : "item", item2 : "item"};
§Example 2
// The type declaration is for the example only and is not needed.
let style2: std::collections::HashMap<String, String> = rust_fetch::map_string!{"item1" => "item", "item2" => "item"};