Skip to content

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

License

Notifications You must be signed in to change notification settings

clintval/fullypeek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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));

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages