itermore
More iterator adaptors.
🚀 Getting started
Add the following to your Cargo manifest.
[]
= "0.2"
And bring the [IterMore] trait into scope
use IterMore;
🤸 Usage
The following additional iterator methods are provided.
next_array
let mut data = 1..5;
let = data.next_array.unwrap;
assert_eq!;
assert_eq!;
The following adaptors are provided.
array_chunks
Similar to slice::array_chunks but for any iterator.
Returns an iterator over N elements of the iterator at a time.
let data = ;
// ^-----^ ^------^
for in data.iter.array_chunks
array_windows
Similar to slice::array_windows but for any iterator.
Returns an iterator over all contiguous windows of length N. The windows
overlap.
let data = ;
// ^---^
// ^--^
// ^--^
for in data.iter.array_windows
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.