|
|
@ -71,7 +71,7 @@ enum List {
|
|
|
|
<span class="filename">文件名: src/main.rs</span>
|
|
|
|
<span class="filename">文件名: src/main.rs</span>
|
|
|
|
|
|
|
|
|
|
|
|
```rust,ignore
|
|
|
|
```rust,ignore
|
|
|
|
use List::{Cons, Nil};
|
|
|
|
use crate::List::{Cons, Nil};
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
fn main() {
|
|
|
|
let list = Cons(1, Cons(2, Cons(3, Nil)));
|
|
|
|
let list = Cons(1, Cons(2, Cons(3, Nil)));
|
|
|
@ -145,7 +145,7 @@ enum List {
|
|
|
|
Nil,
|
|
|
|
Nil,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
use List::{Cons, Nil};
|
|
|
|
use crate::List::{Cons, Nil};
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
fn main() {
|
|
|
|
let list = Cons(1,
|
|
|
|
let list = Cons(1,
|
|
|
|