Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- enum List {
- Node(i32,Box<List>),
- Child(Vec<Box<List>>),
- Nil,
- }
- use List::{Child,Node, Nil};
- fn main() {
- let child = Box::new(Child(vec![Box::new(Node(5,Box(Nil)))]));
- let aa = Node(3,child);
- println!("{:?}",aa);
- }
Add Comment
Please, Sign In to add comment