Skip to main content

map_with

Function map_with 

Source
pub fn map_with<'a, T: Clone + 'a, U: 'a, V: 'a>(
    l: impl Iterator<Item = U> + 'a,
    x: T,
    r: impl Fn(U, T) -> V + 'a,
) -> BoxIter<'a, V>
Expand description

For every element y returned by l, return the output of r(y, x).

In case that l returns only a single element, this does not clone x.