peekaboo
Peekable iterator that allows to peek the next N elements without consuming them.
It's no_std compatible by default. It also doesn't perform any allocations.
Examples
Basic usage:
let xs = ;
// create an iterator that allows us to peek at the next 4 element
let mut iter = xs.iter.;
// peek() lets us see into the future
assert_eq!;
assert_eq!;
// the iterator will not advance until we call `next`
assert_eq!;
assert_eq!;
Use
Run cargo add peekaboo (if using a Rust version over 1.62), or manually add
= "0.3.0"
to your Cargo.toml