unsafe fn adjust_prefix<R, T: Element>(
                            n: &mut RawNode<R>,
                            by: usize,
                            leaf: Option<*const T>,
                            consumed: usize,
                        ) {
                            debug_assert!(by > 0);
                            debug_assert!(
                                by <= n.count as usize,
                                "by={:?} > n.count={:?}",
                                by,
                                n.count
                            );
                            let old_count = n.count as usize;
                            n.count -= by as u32;
                            let start: *const _ = &n.prefix[by];
                            ptr::copy(start, &mut n.prefix[0], n.count as usize);
                            if old_count > PREFIX_LEN {
                                let leaf_ref = &*leaf.unwrap();
                                for (p, d) in n.prefix[PREFIX_LEN - by..]
                                    .iter_mut()
                                    .zip(leaf_ref.key().digits().skip(consumed))
                                {
                                    *p = d;
                                }
                            }
                        }
// Case 4: Our inner node shares a non-matching prefix with the current node.
//
// Here we have to figure out where the mismatch is and create a new parent
// node for the inner node and our current node.
Case 4: Our inner node shares a non-matching prefix with the current node.
Here we have to figure out where the mismatch is and create a new parent
node for the inner node and our current node.
Case 4 : Our inner node shares a non - matching prefix with the current node . Here we have to figure out where the mismatch is and create a new parent node for the inner node and our current node .
unsafe fn adjust_prefix<R, T: Element>(
                            n: &mut RawNode<R>,
                            by: usize,
                            leaf: Option<*const T>,
                            consumed: usize,
                        ) {
                            debug_assert!(by > 0);
                            debug_assert!(
                                by <= n.count as usize,
                                "by={:?} > n.count={:?}",
                                by,
                                n.count
                            );
                            let old_count = n.count as usize;
                            n.count -= by as u32;
                            let start: *const _ = &n.prefix[by];
                            ptr::copy(start, &mut n.prefix[0], n.count as usize);
                            if old_count > PREFIX_LEN {
                                let leaf_ref = &*leaf.unwrap();
                                for (p, d) in n.prefix[PREFIX_LEN - by..]
                                    .iter_mut()
                                    .zip(leaf_ref.key().digits().skip(consumed))
                                {
                                    *p = d;
                                }
                            }
                        }
unsafe fn adjust_prefix < R , T : Element > ( n : & mut RawNode < R > , by : usize , leaf : Option < * const T > , consumed : usize , ) { debug_assert ! ( by 0 ) ; debug_assert ! ( by n count as usize " " by n count ) ; let old_count = n . count as usize ; n . count -= by as u32 ; let start : * const _ = & n . prefix [ by ] ; ptr :: copy ( start , & mut n . prefix [ 0 ] , n . count as usize ) ; if old_count > PREFIX_LEN { let leaf_ref = & * leaf . unwrap ( ) ; for ( p , d ) in n . prefix [ PREFIX_LEN - by .. ] . iter_mut ( ) . zip ( leaf_ref . key ( ) . digits ( ) . skip ( consumed ) ) { * p = d ; } } }
Case 4: Our inner node shares a non-matching prefix with the current node.
Case 4 : Our inner node shares a non - matching prefix with the current node .
n
&mut RawNode<R>
by
usize
leaf
Option<*const T>
consumed
usize
n
&mut RawNode<R>
by
usize
leaf
Option<*const T>
consumed
usize