array_chunks

Crates.ioarray_chunks
lib.rsarray_chunks
version1.0.0
created_at2025-07-31 05:47:13.61296+00
updated_at2025-07-31 05:47:13.61296+00
descriptionadds array_chunks back in
homepage
repositoryhttps://github.com/bend-n/atools
max_upload_size
id1774426
size13,272
bendn (bend-n)

documentation

README

After array_chunks was brutally taken from us in #143289, I have taken it upon myself to diligently add it back to rust.

rust 1.88.0 rust stable

An iterator over a slice in (non-overlapping) chunks (N elements at a time), starting at the beginning of the slice.

use array_chunks::*;
let slice = ['l', 'o', 'r', 'e', 'm'];
let mut iter = slice.array_chunks::<2>();
assert_eq!(iter.next(), Some(&['l', 'o']));
assert_eq!(iter.next(), Some(&['r', 'e']));
assert_eq!(iter.next(), None);
Commit count: 6

cargo fmt