find-fold 0.1.0

Find values through iterator folding
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented1 out of 2 items with examples
  • Size
  • Source code size: 4.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 248.75 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • gastrodon

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