Created
December 6, 2019 00:41
-
-
Save jamesmcm/c897b5c20e23d2985ee71576d6467b68 to your computer and use it in GitHub Desktop.
move_child.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Node { | |
| value: Symbol, | |
| children: (Option<Box<Node>>, Option<Box<Node>>), | |
| } | |
| let movechild = ((&root).as_ref().unwrap().children).1; | |
| (&mut root).as_mut().unwrap().children.1 = Some(Box::new(Node::new(symbol, (movechild, None)))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment