Advertisement
Guest User

Untitled

a guest
Jan 10th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.32 KB | None | 0 0
  1. use std::collections::HashMap;
  2.  
  3. fn main() {
  4.     let mut hm: HashMap<String, [String; 2]> = HashMap::new();
  5.     let mut hm1: HashMap<String, i32> = HashMap::new();
  6.     let arr = ["a".to_string(), "b".to_string()];
  7.     hm.insert("xyz".to_string(), arr);
  8.     for s in arr.iter() {
  9.         hm1.entry(s).or_insert(0);
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement