itertools.multi_cartesian_product

Running this:

use itertools::Itertools;
let v:Vec<Vec<_>> = vec![vec![1,2],vec![3,4],vec![5,6]];
let vp:Vec<Vec<_>> = v.into_iter()
    .multi_cartesian_product()
    .collect();
println!("{:?}", &vp);

Gives you this:

[[1, 3, 5], [1, 3, 6], [1, 4, 5], [1, 4, 6], [2, 3, 5], [2, 3, 6], [2, 4, 5], [2, 4, 6]]

And it's glorious.

Day 17 has actual implementation example of it.