You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation doesn't specify the order in which NodeRef::traverse and NodeRef::descendants iterate over the nodes. This information should be added to the documentation. I.e. breadth-first, depth-first or something else?
In my specific usecase the only important thing about the order would be a guarantee that a node won't be visited before it's parent.
(A similar ambiguity applies to NodeRef::ancestors too.)
PS. This is a nice crate providing an intuitive tree structure!
The text was updated successfully, but these errors were encountered:
The order is depth-first, with traverse returning Edges instead of NodeRefs. Edge seems to be a thin wrapper around NodeRef, and only adds Open/Close variants. (Pardon me if I'm being illiterate, but the variant meanings are not obvious to me.) Apparently Edge::Close just means that the node has been visited already.
Anyway descendants skips the Edges and just yields NodeRefs in depth-first order, just as expected 👍🏻
The documentation doesn't specify the order in which
NodeRef::traverse
andNodeRef::descendants
iterate over the nodes. This information should be added to the documentation. I.e. breadth-first, depth-first or something else?In my specific usecase the only important thing about the order would be a guarantee that a node won't be visited before it's parent.
(A similar ambiguity applies to
NodeRef::ancestors
too.)PS. This is a nice crate providing an intuitive tree structure!
The text was updated successfully, but these errors were encountered: