Releases: clintval/fullypeek
Releases · clintval/fullypeek
0.1.01
Peek forward in an iterator as far as you'd like, memory allowing!
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));