Hacker News new | ask | show | jobs
by qppo 1990 days ago
Or create an iterator and use Iterator::filter, which is probably a bit more idiomatic.
1 comments

In many languages, creating a pull-based iterator for a tree-shaped data-structure can be tricky. It might require turning the recursion inside out to use an explicit stack... Do you know how well Rust can handle this? I'm not familiar with the details.

In any case, while an iterator might help in the "ast_iterator" example, in the "ast_mapper" example I am not sure if there is a way around it.