Crate find_fold

Source
Expand description

find_fold behaves similarly to find_map, but instead of mapping as we make our way through the iterator, we fold. When we’ve found a value or a folding of values that we want, we can use ControlFlow::Break to break out of the fold with our value. If we never find what we want, return None. Effectively, this is an optional partial fold.

FindFold can be simply imported, and Iterators will have it as a method. This crate does not require std, only using ControlFlow

Traits§

FindFold