Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 998 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 998 Bytes

fullypeek

Build Status Coverage Status Language

Peek forward in an iterator as far as you'd like, memory allowing!

cargo add fullypeek

El Chorro, Spain

let mut peekable = vec![1, 2, 3].into_iter().fully_peekable();

assert_eq!(peekable.peek(), Some(&1));
assert_eq!(peekable.peek_many(2), vec!(Some(&1), Some(&2)));

peekable.next();

assert_eq!(peekable.peek(), Some(&2));
assert_eq!(peekable.peek_many(2), vec!(Some(&2), Some(&3)));

peekable.next();

assert_eq!(peekable.peek(), Some(&3));
assert_eq!(peekable.peek_many(2), vec!(Some(&3), None));