Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::collections::HashMap;
- fn main() {
- let mut hm: HashMap<String, [String; 2]> = HashMap::new();
- let mut hm1: HashMap<String, i32> = HashMap::new();
- let arr = ["a".to_string(), "b".to_string()];
- hm.insert("xyz".to_string(), arr);
- for s in arr.iter() {
- hm1.entry(s).or_insert(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement