Collect all leaf node IDs from the tree structure.
(&self, node: &NodeRef<K, V>, ids: &mut Vec<NodeId>)
| 134 | |
| 135 | /// Collect all leaf node IDs from the tree structure. |
| 136 | fn collect_leaf_ids(&self, node: &NodeRef<K, V>, ids: &mut Vec<NodeId>) { |
| 137 | match node { |
| 138 | NodeRef::Leaf(id, _) => ids.push(*id), |
| 139 | NodeRef::Branch(id, _) => { |
| 140 | if let Some(branch) = self.get_branch(*id) { |
| 141 | for child in &branch.children { |
| 142 | self.collect_leaf_ids(child, ids); |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | /// Recursively check invariants for a node and its children. |
| 150 | fn check_node_invariants( |
no test coverage detected