Function core::iter::select_fold1 [] [src]

fn select_fold1<I, B, FProj, FCmp>(it: I, f_proj: FProj, f_cmp: FCmp) -> Option<(B, I::Item)> where I: Iterator, FProj: FnMut(&I::Item) -> B, FCmp: FnMut(&B, &I::Item, &B, &I::Item) -> bool

Select an element from an iterator based on the given projection and "comparison" function.

This is an idiosyncratic helper to try to factor out the commonalities of {max,min}{,_by}. In particular, this avoids having to implement optimizations several times.