From 883d67216e8bb80fcc5e10863cfcb2cfdce71f3d Mon Sep 17 00:00:00 2001 From: readlnh Date: Wed, 20 Feb 2019 12:44:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3ch15-01-box=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ch15-01-box.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, From 7543688f2c85ada3ef7c229f1b33341c511dad22 Mon Sep 17 00:00:00 2001 From: readlnh Date: Wed, 20 Feb 2019 12:52:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3ch15=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ch15-04-rc.md | 6 +++--- src/ch15-05-interior-mutability.md | 2 +- src/ch15-06-reference-cycles.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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)]