# iterchunks [![Crates.io Version](https://badgers.space/crates/version/iterchunks)](https://crates.io/crates/iterchunks) [![Docs.rs Latest](https://badgers.space/badge/docs.rs/latest/blue)](https://docs.rs/iterchunks) [![Build Status](https://badgers.space/github/checks/rossmacarthur/itermore?label=build)](https://github.com/rossmacarthur/itermore/actions/workflows/build.yaml) This crate provides an iterator adapter that yields N elements of the iterator at a time. ### Deprecated This crate is deprecated in favour of the `itermore` crate and it currently just re-exports types from there. The following dependency definition is the equivalent of using this crate. ```toml # Cargo.toml [dependencies] itermore = { version = "...", default-features = false, features = ["array_chunks"] } ``` ## Getting started Add the crate to your Cargo manifest. ```sh cargo add iterchunks ``` And bring the `IterArrayChunks` trait into scope. ```rust use iterchunks::IterArrayChunks; ``` Now you can use the [`array_chunks`] method on any iterator. ```rust for [a, b, c] in iter.array_chunks() { println!("{} {} {}", a, b, c) } ``` Generally the size of `N` can be inferred by the compiler but you can also specify it manually. ```rust let c = iter.array_chunks::<3>(); ``` [`array_chunks`]: IterArrayChunks::array_chunks ## License This project is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details.