mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
172 B
11 lines
172 B
4 years ago
|
enum List {
|
||
|
Cons(i32, Box<List>),
|
||
|
Nil,
|
||
|
}
|
||
|
|
||
|
use crate::List::{Cons, Nil};
|
||
|
|
||
|
fn main() {
|
||
|
let list = Cons(1, Box::new(Cons(2, Box::new(Cons(3, Box::new(Nil))))));
|
||
|
}
|