pub fn splice_in_childs(root: &NodePtr<T>, pos: usize, tree: NodePtr<T>) -> &NodePtr<T> {
        let mut broot = root.borrow_mut();
        let pos = if pos > broot.siblings.len() {
            broot.siblings.len() - 1
        } else {
            pos
        };

        for child in tree.borrow().siblings.iter().rev() {
            broot.siblings.insert(pos, child.clone());
        }

        root
    }
/// Pushes node as a subnode for specified root node.
///
/// Changes node's parent to be root, and pushes node to list of
/// root's subnodes.
///
/// # Examples
///
/// ```
/// let root = Tree::new(0);
/// Tree::push_child(&root, 1);
/// Tree::push_child(&root, 5);
///
/// let other = Tree::new(0);
/// Tree::push_child(&other, 2);
/// Tree::push_child(&other, 3);
/// Tree::push_child(&other, 4);
///
/// Tree::splice_in_childs(&root, 1, other);
///
/// assert_eq!(root.borrow().to_string, "(0 (1) (2) (3) (4) (5))");
/// ```
///
Pushes node as a subnode for specified root node.
Changes node's parent to be root, and pushes node to list of
root's subnodes.
Pushes node as a subnode for specified root node . Changes node ' s parent to be root and pushes node to list of root ' s subnodes .
pub fn splice_in_childs(root: &NodePtr<T>, pos: usize, tree: NodePtr<T>) -> &NodePtr<T> {
        let mut broot = root.borrow_mut();
        let pos = if pos > broot.siblings.len() {
            broot.siblings.len() - 1
        } else {
            pos
        };
        for child in tree.borrow().siblings.iter().rev() {
            broot.siblings.insert(pos, child.clone());
        }
        root
    }
pub fn splice_in_childs ( root : & NodePtr < T > , pos : usize , tree : NodePtr < T > ) -> & NodePtr < T > { let mut broot = root . borrow_mut ( ) ; let pos = if pos > broot . siblings . len ( ) { broot . siblings . len ( ) - 1 } else { pos } ; for child in tree . borrow ( ) . siblings . iter ( ) . rev ( ) { broot . siblings . insert ( pos , child . clone ( ) ) ; } root }
Pushes node as a subnode for specified root node.
Pushes node as a subnode for specified root node .
root
&NodePtr<T>
pos
usize
tree
NodePtr<T>
examples


let other = Tree::new(0);
Tree::push_child(&other, 2);
Tree::push_child(&other, 3);
Tree::push_child(&other, 4).

:splice_in_childs(&root, 1, other).


let other = Tree :: new ( 0 ) ; Tree :: push_child ( &other 2 ) ; Tree :: push_child ( &other 3 ) ; Tree :: push_child ( &other 4 ) . : splice_in_childs ( &root 1 other ) .