itertools icon indicating copy to clipboard operation
itertools copied to clipboard

Add array_windows to as opposed to tuple_windows

Open jamespharaoh opened this issue 2 years ago • 1 comments

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.

jamespharaoh avatar Mar 27 '23 09:03 jamespharaoh

Hi there, we do not have const generics in our minimum supported Rust version.

See https://github.com/rust-itertools/itertools/issues/547.

phimuemue avatar Mar 27 '23 09:03 phimuemue