in src/tree.rs [345:360]
fn add_child(&mut self, parent: usize, dir: ChildDir) {
let mut node: TreeNode<P> = TreeNode::new(NodeType::Internal);
node.set_parent(parent); // Link the parent to the child node.
self.nodes.push(node);
let len = self.nodes.len();
// Link the child to the parent node.
match dir {
ChildDir::Left => {
self.nodes[parent].set_lch(len - 1);
}
ChildDir::Right => {
self.nodes[parent].set_rch(len - 1);
}
}
}