From 2ef9ed69ed0d7fb20f1361d0583961fe4f039865 Mon Sep 17 00:00:00 2001 From: chenxuuu Date: Tue, 11 Jan 2022 16:05:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20```=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/contents/advance/comment.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/contents/advance/comment.md b/book/contents/advance/comment.md index 01ac52f9..bf2c6355 100644 --- a/book/contents/advance/comment.md +++ b/book/contents/advance/comment.md @@ -84,22 +84,22 @@ pub fn add_one(x: i32) -> i32 { #### 文档块注释`/** ... */` 与代码注释一样,文档也有块注释,当注释内容多时,可以减少`///`的使用: -```rust +````rust /** `add_two`将指定值加2. # Examples -\`\`\` +``` let arg = 5; let answer = my_crate::add_two(arg); assert_eq!(7, answer); -\`\`\` +``` */ pub fn add_two(x: i32) -> i32 { x + 2 } -``` +```` #### 查看文档cargo doc 锦衣不夜行,这是中国人的传统美德。我们写了这么漂亮的文档注释,当然要看看网页中是什么效果咯。 From c12f18b9c9c74a129905c8b87c3f9cbeb3a848a7 Mon Sep 17 00:00:00 2001 From: chenxuuu Date: Tue, 11 Jan 2022 17:49:18 +0800 Subject: [PATCH 2/2] fix: Boxt -> Box --- book/contents/advance/smart-pointer/box.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/contents/advance/smart-pointer/box.md b/book/contents/advance/smart-pointer/box.md index 140be256..6a6e4574 100644 --- a/book/contents/advance/smart-pointer/box.md +++ b/book/contents/advance/smart-pointer/box.md @@ -45,7 +45,7 @@ fn foo(x: &str) -> String { 以上场景,我们在本章将一一讲解,后面车速较快,请系好安全带。 #### 使用`Box`将数据存储在堆上 -如果一个变量拥有一个数值`let a = 3`, 那变量`a`必然是存储在栈上的,那如果我们想要`a`的值存储在堆上就需要使用`Boxt`: +如果一个变量拥有一个数值`let a = 3`, 那变量`a`必然是存储在栈上的,那如果我们想要`a`的值存储在堆上就需要使用`Box`: ```rust fn main() { let a = Box::new(3); @@ -114,7 +114,7 @@ error[E0072]: recursive type `List` has infinite size //递归类型`List`拥有 | ---- recursive without indirection ``` -此时若想解决这个问题,就可以使用我们的`Boxt`: +此时若想解决这个问题,就可以使用我们的`Box`: ```rust enum List { Cons(i32, Box),