Crates.io | peeking-iter |
lib.rs | peeking-iter |
version | 0.2.0 |
source | src |
created_at | 2024-05-27 09:13:22.69855 |
updated_at | 2024-07-11 16:10:33.194817 |
description | An iterator adapter that allows infinitely-deep peeking |
homepage | |
repository | https://github.com/Froloket64/peeking-iter |
max_upload_size | |
id | 1253210 |
size | 18,472 |
A fast and simple iterator adapter that allows peeking with any depth:
use peeking_iter::PeekingIter
fn main() {
let it = PeekingIter::new(0..=2);
assert_eq!(it.next(), Some(0));
assert_eq!(it.peek(), Some(1));
assert_eq!(it.peek(), Some(2));
assert_eq!(it.next(), Some(1));
assert_eq!(it.peek(), Some(2));
assert_eq!(it.peek(), None);
}
MultiPeek
Parser
)