Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::collections::HashMap;
- fn main() {
- // Type inference lets us omit an explicit type signature (which
- // would be `HashMap<String, String>` in this example).
- let mut book_reviews = HashMap::new();
- let mut book_reviews2 = HashMap::new();
- book_reviews.insert("wg1".to_string(), "heheho".to_string());
- book_reviews.insert("wg2".to_string(), "ohhh".to_string());
- book_reviews.insert("wg3".to_string(), "snow".to_string());
- book_reviews2.insert("wg1".to_string(), "blahbloh".to_string());
- book_reviews2.insert("wg2".to_string(), "hihho".to_string());
- for (a, b) in book_reviews.iter().zip(book_reviews2.iter()) {
- println!("{:?} \n {:?}", a, b)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement