fn insert_helper(root: TreeNode, interval_start: usize, interval_len: usize) -> TreeNode {
        match root {
            None => Some(Box::new(Node {
                interval_start,
                interval_len,
                max_len: interval_len,
                left: None,
                right: None,
                height: 1,
            })),
            Some(mut root) => {
                if interval_start < root.interval_start {
                    root.left = Self::insert_helper(root.left.take(), interval_start, interval_len);
                } else {
                    root.right =
                        Self::insert_helper(root.right.take(), interval_start, interval_len);
                }

                Some(Node::fixup(root))
            }
        }
    }
/// Insert helper. Returns new root.
Insert helper. Returns new root.
Insert helper . Returns new root .
fn insert_helper(root: TreeNode, interval_start: usize, interval_len: usize) -> TreeNode {
        match root {
            None => Some(Box::new(Node {
                interval_start,
                interval_len,
                max_len: interval_len,
                left: None,
                right: None,
                height: 1,
            })),
            Some(mut root) => {
                if interval_start < root.interval_start {
                    root.left = Self::insert_helper(root.left.take(), interval_start, interval_len);
                } else {
                    root.right =
                        Self::insert_helper(root.right.take(), interval_start, interval_len);
                }
                Some(Node::fixup(root))
            }
        }
    }
fn insert_helper ( root : TreeNode , interval_start : usize , interval_len : usize ) -> TreeNode { match root { None => Some ( Box :: new ( Node { interval_start , interval_len , max_len : interval_len , left : None , right : None , height : 1 , } ) ) , Some ( mut root ) => { if interval_start < root . interval_start { root . left = Self :: insert_helper ( root . left . take ( ) , interval_start , interval_len ) ; } else { root . right = Self :: insert_helper ( root . right . take ( ) , interval_start , interval_len ) ; } Some ( Node :: fixup ( root ) ) } } }
Insert helper.
Insert helper .
root
TreeNode
interval_start
usize
interval_len
usize
root
TreeNode
interval_start
usize
interval_len
usize