iterchunks/
lib.rs

1//! This crate provides an iterator adapter that yields N elements of the
2//! iterator at a time.
3//!
4//! ## Deprecated
5//!
6//! This crate is deprecated in favour of the [`itermore`] crate and it
7//! currently just re-exports types from there. The following dependency
8//! definition is the equivalent of using this crate.
9//!
10//! ```toml
11//! # Cargo.toml
12//!
13//! [dependencies]
14//! itermore = { version = "...", default-features = false, features = ["array_chunks"] }
15//! ```
16//!
17//! # Getting started
18//!
19//! Add the crate to your Cargo manifest.
20//! ```sh
21//! cargo add iterchunks
22//! ```
23//!
24//! And bring the [`IterArrayChunks`] trait into scope.
25//!
26//! ```
27//! use iterchunks::IterArrayChunks;
28//! ```
29//!
30//! Now you can use the [`array_chunks`] method on any iterator.
31//!
32//! ```
33//! # use iterchunks::IterArrayChunks;
34//! # let iter = [1, 2, 3, 4, 5].into_iter();
35//! for [a, b, c] in iter.array_chunks() {
36//!     println!("{} {} {}", a, b, c)
37//! }
38//! ```
39//!
40//! Generally the size of `N` can be inferred by the compiler but you can also
41//! specify it manually.
42//! ```
43//! # use iterchunks::IterArrayChunks;
44//! # let iter = [1, 2, 3, 4, 5].into_iter();
45//! let c = iter.array_chunks::<3>();
46//! ```
47//!
48//! [`array_chunks`]: IterArrayChunks::array_chunks
49
50#![no_std]
51#![deprecated]
52
53pub use itermore::{ArrayChunks, IterArrayChunks};