Open ronnodas opened 2 months ago
I would like to have a method on "peekable" iterators with roughly the following signature and behavior similar to PeekingNext::peeking_next:
PeekingNext::peeking_next
fn peeking_next_map(&mut self, parse: impl FnOnce(&Self::Item) -> Option<B>) -> Option<B>;
This would allow, for example, peeking for multiple kinds of opening delimiters at once and getting one back "parsed" and not just "validated".
Since such a method can be implemented in terms of a peek (or put_back) method as well, it might make sense to combine this with #679.
peek
put_back
I would like to have a method on "peekable" iterators with roughly the following signature and behavior similar to
PeekingNext::peeking_next
:This would allow, for example, peeking for multiple kinds of opening delimiters at once and getting one back "parsed" and not just "validated".
Since such a method can be implemented in terms of a
peek
(orput_back
) method as well, it might make sense to combine this with #679.