let a = vec![ vec![1, 2], vec![3, 4], vec![5, 6] ];
How can I gather into a single Vec
all the values contained in all the Vec>
Steve's answer is correct, but you should also know about flat_map -- there's a good chance that that's what you really want to use, that it would make your code simpler and faster. You probably don't need to ever create a Vec of Vecs -- just an Iterator of Iterators that you flat_map and then collect.