≈ the.bay.news

Trait for peekable iterators

Rust Internals
Trait for peekable iterators
There's some useful methods on core::iter::Peekable, but those require making an adapter around your trait and then you can't ever get the original iterator back. Since many iterators could peek at their next element, it seems to me like it would be useful to make a trait that allows calling those methods without needing to use the wrapper. I envision the trait looking pretty similar to the current Peekable struct, minus the methods that require mutating (peek_mut, next_if_map, next_if_map_mut)...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.