(&mut self, f: &mut F)
| 369 | } |
| 370 | |
| 371 | fn visit_mut_pre<F>(&mut self, f: &mut F) |
| 372 | where |
| 373 | F: FnMut(&mut Self), |
| 374 | { |
| 375 | let mut stack = vec![self]; |
| 376 | while let Some(elt) = stack.pop() { |
| 377 | f(elt); |
| 378 | // Push children in reverse so they pop (and are visited) left-to-right. |
| 379 | stack.extend(elt.children_mut().rev()) |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | fn try_visit_pre<F, E>(&self, f: &mut F) -> Result<(), E> |
| 384 | where |