#folding #find #control-flow #find-fold

find-fold

Find values through iterator folding

1 unstable release

Uses new Rust 2024

new 0.1.0 Apr 10, 2025

#1 in #folding

Download history 206/week @ 2025-04-08

206 downloads per month
Used in eevee

BSD-3-Clause

3KB

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

No runtime deps