pub fn ensure_child_ref(&mut self, version: u64, is_leaf: bool) {
        if let Some(child_ref) = self.node.child_ref_mut(self.nibble) {
            child_ref.version = version;
            child_ref.is_leaf = is_leaf;
        } else {
            let child_ref = if is_leaf {
                ChildRef::leaf(version)
            } else {
                ChildRef::internal(version)
            };
            self.node.insert_child_ref(self.nibble, child_ref);
        }
    }
Ensures that the child reference for the affected nibble exists. Creates a new reference
with if necessary.
core/lib/merkle_tree/src/hasher/nodes.rs