Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. use std::collections::HashMap;
  2.  
  3. fn main() {
  4. // Type inference lets us omit an explicit type signature (which
  5. // would be `HashMap<String, String>` in this example).
  6. let mut book_reviews = HashMap::new();
  7. let mut book_reviews2 = HashMap::new();
  8.  
  9. book_reviews.insert("wg1".to_string(), "heheho".to_string());
  10. book_reviews.insert("wg2".to_string(), "ohhh".to_string());
  11. book_reviews.insert("wg3".to_string(), "snow".to_string());
  12.  
  13. book_reviews2.insert("wg1".to_string(), "blahbloh".to_string());
  14. book_reviews2.insert("wg2".to_string(), "hihho".to_string());
  15.  
  16. for (a, b) in book_reviews.iter().zip(book_reviews2.iter()) {
  17. println!("{:?} \n {:?}", a, b)
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement