pub fn replace_tree(tree1: &NodePtr<T>, tree2: NodePtr<T>) {
        tree1.borrow_mut().data = tree2.borrow().data.clone();
        tree1.borrow_mut().siblings.clear();
        for c in tree2.borrow().siblings.iter() {
            Tree::push_tree(tree1, c.clone());
        }
    }
/// Replaces one node with another node.
///
/// Keeps current pointer and parent, updates node's data and
/// list of subnodes from the other node.
///
/// # Examples
///
/// ```
/// let root = Tree::new(22);
/// let forty_two = Tree::push_child(&root, 43);
/// Tree::replace_tree(&forty_two, Tree::new(42));
///
/// assert_eq!(root, Tree::get_parent(&Tree::push_child(&Tree::new(22), 42)).unwrap());
/// ```
///
Replaces one node with another node.
Keeps current pointer and parent, updates node's data and
list of subnodes from the other node.
Replaces one node with another node . Keeps current pointer and parent updates node ' s data and list of subnodes from the other node .
pub fn replace_tree(tree1: &NodePtr<T>, tree2: NodePtr<T>) {
        tree1.borrow_mut().data = tree2.borrow().data.clone();
        tree1.borrow_mut().siblings.clear();
        for c in tree2.borrow().siblings.iter() {
            Tree::push_tree(tree1, c.clone());
        }
    }
pub fn replace_tree ( tree1 : & NodePtr < T > , tree2 : NodePtr < T > ) { tree1 . borrow_mut ( ) . data = tree2 . borrow ( ) . data . clone ( ) ; tree1 . borrow_mut ( ) . siblings . clear ( ) ; for c in tree2 . borrow ( ) . siblings . iter ( ) { Tree :: push_tree ( tree1 , c . clone ( ) ) ; } }
Replaces one node with another node.
Replaces one node with another node .
tree1
&NodePtr<T>
tree2
NodePtr<T>
examples
None