pub fn fold<I, B, F>(iterable: I, init: B, f: F) -> B
Expand description
Perform a fold operation over the iterable.
IntoIterator
enabled version of Iterator::fold
.
use itertools::fold;
assert_eq!(fold(&[1., 2., 3.], 0., |a, &b| f32::max(a, b)), 3.);