itertools
itertools copied to clipboard
Add array_windows to as opposed to tuple_windows
Implementing array_windows as opposed to tuple_windows makes things more ergonomic. It would also allow a function to be generic over the number of items, for example:
fn <const LEN: usize> some_function () {
some_iter.array_windows ().map (|arr: [u8; LEN]| do_something (arr));
}
Unless someone knows a reason why tuple_windows might be preferred over array_windows, the former could possibly be deprecated to keep the API simpler.
Hi there, we do not have const generics in our minimum supported Rust version.
See https://github.com/rust-itertools/itertools/issues/547.