diff --git a/src/ch15-01-box.md b/src/ch15-01-box.md index 272bf89..04b88ea 100644 --- a/src/ch15-01-box.md +++ b/src/ch15-01-box.md @@ -71,7 +71,7 @@ enum List { 文件名: src/main.rs ```rust,ignore -use List::{Cons, Nil}; +use crate::List::{Cons, Nil}; fn main() { let list = Cons(1, Cons(2, Cons(3, Nil))); @@ -145,7 +145,7 @@ enum List { Nil, } -use List::{Cons, Nil}; +use crate::List::{Cons, Nil}; fn main() { let list = Cons(1, diff --git a/src/ch15-04-rc.md b/src/ch15-04-rc.md index 8c55f38..9cf870d 100644 --- a/src/ch15-04-rc.md +++ b/src/ch15-04-rc.md @@ -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() { diff --git a/src/ch15-05-interior-mutability.md b/src/ch15-05-interior-mutability.md index d9b7626..2933a48 100644 --- a/src/ch15-05-interior-mutability.md +++ b/src/ch15-05-interior-mutability.md @@ -272,7 +272,7 @@ enum List { Nil, } -use List::{Cons, Nil}; +use crate::List::{Cons, Nil}; use std::rc::Rc; use std::cell::RefCell; diff --git a/src/ch15-06-reference-cycles.md b/src/ch15-06-reference-cycles.md index f051160..2da1aa3 100644 --- a/src/ch15-06-reference-cycles.md +++ b/src/ch15-06-reference-cycles.md @@ -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 { Filename: src/main.rs ```rust -# use List::{Cons, Nil}; +# use crate::List::{Cons, Nil}; # use std::rc::Rc; # use std::cell::RefCell; # #[derive(Debug)]