fn unchecked_insert<T, D>(
    start: T,
    end: T,
    data: Rc<D>,
    right: &mut Node<T, D>,
    free: &mut Range<T>,
) where
    T: Ord + Copy + Debug,
    D: Debug,
{
    assert!(free.start <= start);
    assert!(end <= free.end);

    let new_node = Node::Leaf { start, end, data };

    take_mut::take(right, |right_value| Node::Intermediate {
        left: Box::new(new_node),
        right: Box::new(right_value),
        free: end..free.end,
    });

    *free = free.start..start;
}
/// Inserts a leaf node with given start, end and data in place of the right node of some other
/// node `x`. The original right node of `x` becomes the right node of the right node of `x` and
/// the new node becomes the left node of the right node of `x`. The free range of `x` is also
/// passed and updated.
Inserts a leaf node with given start, end and data in place of the right node of some other
node `x`.
Inserts a leaf node with given start end and data in place of the right node of some other node ` x ` .
fn unchecked_insert<T, D>(
    start: T,
    end: T,
    data: Rc<D>,
    right: &mut Node<T, D>,
    free: &mut Range<T>,
) where
    T: Ord + Copy + Debug,
    D: Debug,
{
    assert!(free.start <= start);
    assert!(end <= free.end);
    let new_node = Node::Leaf { start, end, data };
    take_mut::take(right, |right_value| Node::Intermediate {
        left: Box::new(new_node),
        right: Box::new(right_value),
        free: end..free.end,
    });
    *free = free.start..start;
}
fn unchecked_insert < T , D > ( start : T , end : T , data : Rc < D > , right : & mut Node < T , D > , free : & mut Range < T > , ) where T : Ord + Copy + Debug , D : Debug , { assert ! ( free start start ) ; assert ! ( end free end ) ; let new_node = Node :: Leaf { start , end , data } ; take_mut :: take ( right , | right_value | Node :: Intermediate { left : Box :: new ( new_node ) , right : Box :: new ( right_value ) , free : end .. free . end , } ) ; * free = free . start .. start ; }
Inserts a leaf node with given start, end and data in place of the right node of some other
node `x`.
Inserts a leaf node with given start end and data in place of the right node of some other node ` x ` .
start
T
end
T
data
Rc<D>
right
&mut Node<T, D>
free
&mut Range<T>
start
T
end
T
data
Rc<D>
right
&mut Node<T, D>
free
&mut Range<T>