itertools
itertools copied to clipboard
Collect into array
It'd be really useful since generic tuples aren't out yet
I think it may only be possible if you're using ExactSizeIterator, because we need to know the exact size at compile time.
There's a lot of edge cases to work through with this feature, which is why it's not stable in the standard library yet.
In the meantime, you can use array::from_fn to achieve this, by calling iter.next().unwrap() in the passed closure.