fn absorb(&mut self, key: K, val: V, mut right: Node<K, V>) {
        // Necessary for correctness, but in a private function
        // Just as a sanity check, make sure we can fit this guy in
        debug_assert!(self.len() + right.len() <= self.capacity());
        debug_assert!(self.is_leaf() == right.is_leaf());

        unsafe {
            let old_len = self.len();
            self._len += right.len() + 1;

            ptr::write(self.keys_mut().get_unchecked_mut(old_len), key);
            ptr::write(self.vals_mut().get_unchecked_mut(old_len), val);

            ptr::copy_nonoverlapping(
                right.keys().as_ptr(),
                self.keys_mut().as_mut_ptr().offset(old_len as isize + 1),
                right.len()
            );
            ptr::copy_nonoverlapping(
                right.vals().as_ptr(),
                self.vals_mut().as_mut_ptr().offset(old_len as isize + 1),
                right.len()
            );
            if !self.is_leaf() {
                ptr::copy_nonoverlapping(
                    right.edges().as_ptr(),
                    self.edges_mut().as_mut_ptr().offset(old_len as isize + 1),
                    right.len() + 1
                );
            }

            right.destroy();
            mem::forget(right);
        }
    }
/// Take all the values from right, separated by the given key and value
Take all the values from right, separated by the given key and value
Take all the values from right separated by the given key and value
fn absorb(&mut self, key: K, val: V, mut right: Node<K, V>) {
        // Necessary for correctness, but in a private function
        // Just as a sanity check, make sure we can fit this guy in
        debug_assert!(self.len() + right.len() <= self.capacity());
        debug_assert!(self.is_leaf() == right.is_leaf());
        unsafe {
            let old_len = self.len();
            self._len += right.len() + 1;
            ptr::write(self.keys_mut().get_unchecked_mut(old_len), key);
            ptr::write(self.vals_mut().get_unchecked_mut(old_len), val);
            ptr::copy_nonoverlapping(
                right.keys().as_ptr(),
                self.keys_mut().as_mut_ptr().offset(old_len as isize + 1),
                right.len()
            );
            ptr::copy_nonoverlapping(
                right.vals().as_ptr(),
                self.vals_mut().as_mut_ptr().offset(old_len as isize + 1),
                right.len()
            );
            if !self.is_leaf() {
                ptr::copy_nonoverlapping(
                    right.edges().as_ptr(),
                    self.edges_mut().as_mut_ptr().offset(old_len as isize + 1),
                    right.len() + 1
                );
            }
            right.destroy();
            mem::forget(right);
        }
    }
fn absorb ( & mut self , key : K , val : V , mut right : Node < K , V > ) { // Necessary for correctness, but in a private function // Just as a sanity check, make sure we can fit this guy in debug_assert ! ( self len ( ) right len ( ) self capacity ( ) ) ; debug_assert ! ( self is_leaf ( ) right is_leaf ( ) ) ; unsafe { let old_len = self . len ( ) ; self . _len += right . len ( ) + 1 ; ptr :: write ( self . keys_mut ( ) . get_unchecked_mut ( old_len ) , key ) ; ptr :: write ( self . vals_mut ( ) . get_unchecked_mut ( old_len ) , val ) ; ptr :: copy_nonoverlapping ( right . keys ( ) . as_ptr ( ) , self . keys_mut ( ) . as_mut_ptr ( ) . offset ( old_len as isize + 1 ) , right . len ( ) ) ; ptr :: copy_nonoverlapping ( right . vals ( ) . as_ptr ( ) , self . vals_mut ( ) . as_mut_ptr ( ) . offset ( old_len as isize + 1 ) , right . len ( ) ) ; if ! self . is_leaf ( ) { ptr :: copy_nonoverlapping ( right . edges ( ) . as_ptr ( ) , self . edges_mut ( ) . as_mut_ptr ( ) . offset ( old_len as isize + 1 ) , right . len ( ) + 1 ) ; } right . destroy ( ) ; mem :: forget ( right ) ; } }
Take all the values from right, separated by the given key and value
Take all the values from right separated by the given key and value
&mut self
key
K
val
V
right
Node<K, V>