Crate discard_while
source ·Expand description
Iterator utility for getting the first non-matching element, discarding any others, and the amount of discarded elements.
To use, either use discard_while::discard_while
to get the function,
or use discard_while::DiscardWhile
to get the convenience trait.
Traits
- Convenience trait to allow using
discard_while
as a method. This trait is implemented for everyIterator
.
Functions
- Advance an iterator as long as a condition on the yielded items holds. Returns the first item that no longer satisfies the condition, if any, and the number of items discarded.