use crate::{Item, Key, Node, Value, ARRAY_SIZE};
impl<K: Key, V: Value> Node<K, V> {
pub fn take_items(&mut self) -> [Option<Box<Item<K, V>>>; ARRAY_SIZE] {
let items = self.items.to_owned();
self.items = Default::default();
items
}
pub fn take_child(&mut self, index: usize) -> Option<Box<Node<K, V>>> {
let child = self.children[index].to_owned();
self.children[index] = None;
child
}
pub fn take_child_size(&mut self, index: usize) -> usize {
let child = self.children_size[index].to_owned();
self.children_size[index] = 0;
child
}
}