pub fn transform_and_continue<F>(&mut self, func: &mut F)
    where
        F: FnMut(&mut Expr) -> (Option<Expr>, bool),
    {
        match func(self) {
            (Some(e), true) => {
                *self = e;
                self.transform_and_continue(func)
            }
            (Some(e), false) => {
                *self = e;
            }
            (None, true) => {
                for c in self.children_mut() {
                    c.transform_and_continue(func);
                }
            }
            (None, false) => {}
        }
    }
Recursively transforms an expression in place by running a function on it and optionally replacing it with another expression.
weld/src/ast/ast.rs