Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let v1 = vec![String::from("foo"), String::from("bar")];
- let v2 = vec![String::from("baz"), String::from("qux")];
- let it = v1.iter().map(|s1| v2.iter().map(|s2| (s1, s2))).flat_map(|x| x);
- for item in it {
- let (s1, s2) = item;
- println!("{} {}", s1, s2)
- }
- }
Add Comment
Please, Sign In to add comment