fn fold<F, T>(&self, init: T, mut f: F) -> T
    where
        F: FnMut(T, Id) -> T,
        T: Clone,
    {
        let mut acc = init;
        self.for_each(|id| acc = f(acc.clone(), id));
        acc
    }
/// Folds over the children, given an initial accumulator.
Folds over the children, given an initial accumulator.
Folds over the children given an initial accumulator .
fn fold<F, T>(&self, init: T, mut f: F) -> T
    where
        F: FnMut(T, Id) -> T,
        T: Clone,
    {
        let mut acc = init;
        self.for_each(|id| acc = f(acc.clone(), id));
        acc
    }
fn fold < F , T > ( & self , init : T , mut f : F ) -> T where F : FnMut ( T , Id ) -> T , T : Clone , { let mut acc = init ; self . for_each ( | id | acc = f ( acc . clone ( ) , id ) ) ; acc }
Folds over the children, given an initial accumulator.
Folds over the children given an initial accumulator .
&self
init
T
f
F
&self
init
T
f
F