Returns a copy of the next() value without advancing the iterator.
Like next, if there is a value, it is wrapped in a Some(T).
But if the iteration is over, None is returned.
let mut iter = (1..4_u8).into_iter().peekable();// peek() lets us see one step into the futureassert_eq!(iter.peek(), Some(1));assert_eq!(iter.next(), Some(1));assert_eq!(iter.next(), Some(2));// The iterator does not advance even if we `peek` multiple timesassert_eq!(iter.peek(), Some(3));assert_eq!(iter.peek(), Some(3));assert_eq!(iter.next(), Some(3));// After the iterator is finished, so is `peek()`assert_eq!(iter.peek(), None);assert_eq!(iter.next(), None);