Add to `entered` that we have entered `node` and `node` has `children`.
(
entered: &mut Vec<(NodeId, Vec<NodeId>)>,
node: NodeId,
mut children: Vec<NodeId>,
)
| 205 | |
| 206 | /// Add to `entered` that we have entered `node` and `node` has `children`. |
| 207 | fn entered_node<NodeId>( |
| 208 | entered: &mut Vec<(NodeId, Vec<NodeId>)>, |
| 209 | node: NodeId, |
| 210 | mut children: Vec<NodeId>, |
| 211 | ) where |
| 212 | NodeId: std::cmp::Ord, |
| 213 | { |
| 214 | // Reverse children because `find_next_child_to_enter` will traverse the |
| 215 | // list of children by popping them out from the back. |
| 216 | children.reverse(); |
| 217 | entered.push((node, children)) |
| 218 | } |
| 219 | |
| 220 | /// Find the next child node, if any, that we have not entered. |
| 221 | fn find_next_child_to_enter<NodeId>( |
no test coverage detected