修正ch15中的代码

This commit is contained in:
readlnh 2019-02-20 12:52:11 +08:00
parent 883d67216e
commit 7543688f2c
3 changed files with 6 additions and 6 deletions

View File

@ -34,7 +34,7 @@ enum List {
Nil,
}
use List::{Cons, Nil};
use crate::List::{Cons, Nil};
fn main() {
let a = Cons(5,
@ -76,7 +76,7 @@ enum List {
Nil,
}
use List::{Cons, Nil};
use crate::List::{Cons, Nil};
use std::rc::Rc;
fn main() {
@ -106,7 +106,7 @@ fn main() {
# Nil,
# }
#
# use List::{Cons, Nil};
# use crate::List::{Cons, Nil};
# use std::rc::Rc;
#
fn main() {

View File

@ -272,7 +272,7 @@ enum List {
Nil,
}
use List::{Cons, Nil};
use crate::List::{Cons, Nil};
use std::rc::Rc;
use std::cell::RefCell;

View File

@ -19,7 +19,7 @@ doc tests do; the `use List` fails if this listing is put within a main -->
# fn main() {}
use std::rc::Rc;
use std::cell::RefCell;
use List::{Cons, Nil};
use crate::List::{Cons, Nil};
#[derive(Debug)]
enum List {
@ -46,7 +46,7 @@ impl List {
<span class="filename">Filename: src/main.rs</span>
```rust
# use List::{Cons, Nil};
# use crate::List::{Cons, Nil};
# use std::rc::Rc;
# use std::cell::RefCell;
# #[derive(Debug)]