Guest User

Untitled

a guest
Jun 24th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. fn main() {
  2. let v1 = vec![String::from("foo"), String::from("bar")];
  3. let v2 = vec![String::from("baz"), String::from("qux")];
  4.  
  5. let it = v1.iter().map(|s1| v2.iter().map(|s2| (s1, s2))).flat_map(|x| x);
  6.  
  7. for item in it {
  8. let (s1, s2) = item;
  9. println!("{} {}", s1, s2)
  10. }
  11. }
Add Comment
Please, Sign In to add comment