From f75ad6909a5dbd2bcd7b7552e6de78fde5d1162c Mon Sep 17 00:00:00 2001 From: stevenlele Date: Tue, 19 Jul 2022 23:03:24 +0800 Subject: [PATCH] Update contents for ch00-10 --- src/README.md | 42 +++++++++---------- src/SUMMARY.md | 40 +++++++++--------- src/ch05-01-defining-structs.md | 2 +- src/ch05-02-example-structs.md | 2 +- src/ch06-01-defining-an-enum.md | 2 +- src/ch06-02-match.md | 2 +- src/ch06-03-if-let.md | 2 +- ...ojects-with-packages-crates-and-modules.md | 2 +- src/ch07-01-packages-and-crates.md | 2 +- ...referring-to-an-item-in-the-module-tree.md | 2 +- ...g-paths-into-scope-with-the-use-keyword.md | 2 +- ...separating-modules-into-different-files.md | 2 +- src/ch08-01-vectors.md | 2 +- src/ch08-02-strings.md | 2 +- src/ch08-03-hash-maps.md | 2 +- ...ch09-01-unrecoverable-errors-with-panic.md | 2 +- src/ch09-02-recoverable-errors-with-result.md | 2 +- src/ch09-03-to-panic-or-not-to-panic.md | 2 +- src/ch10-00-generics.md | 2 +- src/ch10-02-traits.md | 2 +- src/ch10-03-lifetime-syntax.md | 2 +- 21 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/README.md b/src/README.md index dbd19ab..0e8b54b 100644 --- a/src/README.md +++ b/src/README.md @@ -2,7 +2,7 @@ [Rust 程序设计语言](title-page.md) [前言](foreword.md) -[介绍](ch00-00-introduction.md) +[简介](ch00-00-introduction.md) ## 入门指南 @@ -11,7 +11,7 @@ - [Hello, World!](ch01-02-hello-world.md) - [Hello, Cargo!](ch01-03-hello-cargo.md) -- [猜猜看游戏教程](ch02-00-guessing-game-tutorial.md) +- [写个猜数字游戏](ch02-00-guessing-game-tutorial.md) - [常见编程概念](ch03-00-common-programming-concepts.md) - [变量与可变性](ch03-01-variables-and-mutability.md) @@ -25,39 +25,39 @@ - [引用与借用](ch04-02-references-and-borrowing.md) - [Slice 类型](ch04-03-slices.md) -- [使用结构体来组织相关联的数据](ch05-00-structs.md) - - [定义并实例化结构体](ch05-01-defining-structs.md) - - [一个使用结构体的示例程序](ch05-02-example-structs.md) +- [使用结构体组织相关联的数据](ch05-00-structs.md) + - [结构体的定义和实例化](ch05-01-defining-structs.md) + - [结构体示例程序](ch05-02-example-structs.md) - [方法语法](ch05-03-method-syntax.md) -- [枚举与模式匹配](ch06-00-enums.md) - - [定义枚举](ch06-01-defining-an-enum.md) - - [`match` 控制流运算符](ch06-02-match.md) +- [枚举和模式匹配](ch06-00-enums.md) + - [枚举的定义](ch06-01-defining-an-enum.md) + - [`match` 控制流结构](ch06-02-match.md) - [`if let` 简洁控制流](ch06-03-if-let.md) ## 基本 Rust 技能 - [使用包、Crate 和模块管理不断增长的项目](ch07-00-managing-growing-projects-with-packages-crates-and-modules.md) - - [包和 crate](ch07-01-packages-and-crates.md) + - [包和 Crate](ch07-01-packages-and-crates.md) - [定义模块来控制作用域与私有性](ch07-02-defining-modules-to-control-scope-and-privacy.md) - - [路径用于引用模块树中的项](ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md) - - [使用 `use` 关键字将名称引入作用域](ch07-04-bringing-paths-into-scope-with-the-use-keyword.md) - - [将模块分割进不同文件](ch07-05-separating-modules-into-different-files.md) + - [引用模块项目的路径](ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md) + - [使用 `use` 关键字将路径引入作用域](ch07-04-bringing-paths-into-scope-with-the-use-keyword.md) + - [将模块拆分成多个文件](ch07-05-separating-modules-into-different-files.md) - [常见集合](ch08-00-common-collections.md) - - [使用可变长数组(Vector)存储一列值](ch08-01-vectors.md) - - [使用字符串(String)存储UTF-8编码的文本](ch08-02-strings.md) - - [在哈希映射中存储键和关联值](ch08-03-hash-maps.md) + - [使用 Vector 储存列表](ch08-01-vectors.md) + - [使用字符串储存 UTF-8 编码的文本](ch08-02-strings.md) + - [使用 Hash Map 储存键值对](ch08-03-hash-maps.md) - [错误处理](ch09-00-error-handling.md) - - [`panic!` 与不可恢复的错误](ch09-01-unrecoverable-errors-with-panic.md) - - [`Result` 与可恢复的错误](ch09-02-recoverable-errors-with-result.md) - - [`panic!` 还是不 `panic!`](ch09-03-to-panic-or-not-to-panic.md) + - [用 `panic!` 处理不可恢复的错误](ch09-01-unrecoverable-errors-with-panic.md) + - [用 `Result` 处理可恢复的错误](ch09-02-recoverable-errors-with-result.md) + - [要不要 `panic!`](ch09-03-to-panic-or-not-to-panic.md) -- [泛型、trait 与生命周期](ch10-00-generics.md) +- [泛型、Trait 和生命周期](ch10-00-generics.md) - [泛型数据类型](ch10-01-syntax.md) - - [trait:定义共享的行为](ch10-02-traits.md) - - [生命周期与引用有效性](ch10-03-lifetime-syntax.md) + - [Trait:定义共同行为](ch10-02-traits.md) + - [生命周期确保引用有效](ch10-03-lifetime-syntax.md) - [编写自动化测试](ch11-00-testing.md) - [如何编写测试](ch11-01-writing-tests.md) diff --git a/src/SUMMARY.md b/src/SUMMARY.md index bcb7ad1..0e8b54b 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -2,7 +2,7 @@ [Rust 程序设计语言](title-page.md) [前言](foreword.md) -[介绍](ch00-00-introduction.md) +[简介](ch00-00-introduction.md) ## 入门指南 @@ -25,39 +25,39 @@ - [引用与借用](ch04-02-references-and-borrowing.md) - [Slice 类型](ch04-03-slices.md) -- [使用结构体来组织相关联的数据](ch05-00-structs.md) - - [定义并实例化结构体](ch05-01-defining-structs.md) - - [一个使用结构体的示例程序](ch05-02-example-structs.md) +- [使用结构体组织相关联的数据](ch05-00-structs.md) + - [结构体的定义和实例化](ch05-01-defining-structs.md) + - [结构体示例程序](ch05-02-example-structs.md) - [方法语法](ch05-03-method-syntax.md) -- [枚举与模式匹配](ch06-00-enums.md) - - [定义枚举](ch06-01-defining-an-enum.md) - - [`match` 控制流运算符](ch06-02-match.md) +- [枚举和模式匹配](ch06-00-enums.md) + - [枚举的定义](ch06-01-defining-an-enum.md) + - [`match` 控制流结构](ch06-02-match.md) - [`if let` 简洁控制流](ch06-03-if-let.md) ## 基本 Rust 技能 - [使用包、Crate 和模块管理不断增长的项目](ch07-00-managing-growing-projects-with-packages-crates-and-modules.md) - - [包和 crate](ch07-01-packages-and-crates.md) + - [包和 Crate](ch07-01-packages-and-crates.md) - [定义模块来控制作用域与私有性](ch07-02-defining-modules-to-control-scope-and-privacy.md) - - [路径用于引用模块树中的项](ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md) - - [使用 `use` 关键字将名称引入作用域](ch07-04-bringing-paths-into-scope-with-the-use-keyword.md) - - [将模块分割进不同文件](ch07-05-separating-modules-into-different-files.md) + - [引用模块项目的路径](ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md) + - [使用 `use` 关键字将路径引入作用域](ch07-04-bringing-paths-into-scope-with-the-use-keyword.md) + - [将模块拆分成多个文件](ch07-05-separating-modules-into-different-files.md) - [常见集合](ch08-00-common-collections.md) - - [使用可变长数组(Vector)存储一列值](ch08-01-vectors.md) - - [使用字符串(String)存储UTF-8编码的文本](ch08-02-strings.md) - - [在哈希映射中存储键和关联值](ch08-03-hash-maps.md) + - [使用 Vector 储存列表](ch08-01-vectors.md) + - [使用字符串储存 UTF-8 编码的文本](ch08-02-strings.md) + - [使用 Hash Map 储存键值对](ch08-03-hash-maps.md) - [错误处理](ch09-00-error-handling.md) - - [`panic!` 与不可恢复的错误](ch09-01-unrecoverable-errors-with-panic.md) - - [`Result` 与可恢复的错误](ch09-02-recoverable-errors-with-result.md) - - [`panic!` 还是不 `panic!`](ch09-03-to-panic-or-not-to-panic.md) + - [用 `panic!` 处理不可恢复的错误](ch09-01-unrecoverable-errors-with-panic.md) + - [用 `Result` 处理可恢复的错误](ch09-02-recoverable-errors-with-result.md) + - [要不要 `panic!`](ch09-03-to-panic-or-not-to-panic.md) -- [泛型、trait 与生命周期](ch10-00-generics.md) +- [泛型、Trait 和生命周期](ch10-00-generics.md) - [泛型数据类型](ch10-01-syntax.md) - - [trait:定义共享的行为](ch10-02-traits.md) - - [生命周期与引用有效性](ch10-03-lifetime-syntax.md) + - [Trait:定义共同行为](ch10-02-traits.md) + - [生命周期确保引用有效](ch10-03-lifetime-syntax.md) - [编写自动化测试](ch11-00-testing.md) - [如何编写测试](ch11-01-writing-tests.md) diff --git a/src/ch05-01-defining-structs.md b/src/ch05-01-defining-structs.md index 162dd8d..9901309 100644 --- a/src/ch05-01-defining-structs.md +++ b/src/ch05-01-defining-structs.md @@ -1,4 +1,4 @@ -## 定义并实例化结构体 +## 结构体的定义和实例化 > [ch05-01-defining-structs.md](https://github.com/rust-lang/book/blob/main/src/ch05-01-defining-structs.md) >
diff --git a/src/ch05-02-example-structs.md b/src/ch05-02-example-structs.md index babf37b..9dc2051 100644 --- a/src/ch05-02-example-structs.md +++ b/src/ch05-02-example-structs.md @@ -1,4 +1,4 @@ -## 一个使用结构体的示例程序 +## 结构体示例程序 > [ch05-02-example-structs.md](https://github.com/rust-lang/book/blob/main/src/ch05-02-example-structs.md) >
diff --git a/src/ch06-01-defining-an-enum.md b/src/ch06-01-defining-an-enum.md index a345385..c38182b 100644 --- a/src/ch06-01-defining-an-enum.md +++ b/src/ch06-01-defining-an-enum.md @@ -1,4 +1,4 @@ -## 定义枚举 +## 枚举的定义 > [ch06-01-defining-an-enum.md](https://github.com/rust-lang/book/blob/main/src/ch06-01-defining-an-enum.md) >
diff --git a/src/ch06-02-match.md b/src/ch06-02-match.md index 1d64a5c..25e646d 100644 --- a/src/ch06-02-match.md +++ b/src/ch06-02-match.md @@ -1,4 +1,4 @@ -## `match` 控制流运算符 +## `match` 控制流结构 > [ch06-02-match.md](https://github.com/rust-lang/book/blob/main/src/ch06-02-match.md) >
diff --git a/src/ch06-03-if-let.md b/src/ch06-03-if-let.md index 69c62ee..8241f88 100644 --- a/src/ch06-03-if-let.md +++ b/src/ch06-03-if-let.md @@ -1,4 +1,4 @@ -## `if let` 简单控制流 +## `if let` 简洁控制流 > [ch06-03-if-let.md](https://github.com/rust-lang/book/blob/main/src/ch06-03-if-let.md) >
diff --git a/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md b/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md index 1f95c7a..4d0832a 100644 --- a/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md +++ b/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md @@ -1,4 +1,4 @@ -# 使用包、Crate和模块管理不断增长的项目 +# 使用包、Crate 和模块管理不断增长的项目 > [ch07-00-managing-growing-projects-with-packages-crates-and-modules.md](https://github.com/rust-lang/book/blob/main/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md) >
diff --git a/src/ch07-01-packages-and-crates.md b/src/ch07-01-packages-and-crates.md index aab9d16..6372b00 100644 --- a/src/ch07-01-packages-and-crates.md +++ b/src/ch07-01-packages-and-crates.md @@ -1,4 +1,4 @@ -## 包和 crate +## 包和 Crate > [ch07-01-packages-and-crates.md](https://github.com/rust-lang/book/blob/main/src/ch07-01-packages-and-crates.md) >
diff --git a/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md b/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md index 5a872f1..4b0e99e 100644 --- a/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md +++ b/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md @@ -1,4 +1,4 @@ -## 路径用于引用模块树中的项 +## 引用模块项目的路径 > [ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md](https://github.com/rust-lang/book/blob/main/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md) >
> commit 9c0fa2714859738ff73cbbb829592e4c037d7e46 diff --git a/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md b/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md index b3d42fc..d1ed12c 100644 --- a/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md +++ b/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md @@ -1,4 +1,4 @@ -## 使用 `use` 关键字将名称引入作用域 +## 使用 `use` 关键字将路径引入作用域 > [ch07-04-bringing-paths-into-scope-with-the-use-keyword.md](https://github.com/rust-lang/book/blob/main/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md) >
diff --git a/src/ch07-05-separating-modules-into-different-files.md b/src/ch07-05-separating-modules-into-different-files.md index 3f8ea8d..8c53935 100644 --- a/src/ch07-05-separating-modules-into-different-files.md +++ b/src/ch07-05-separating-modules-into-different-files.md @@ -1,4 +1,4 @@ -## 将模块分割进不同文件 +## 将模块拆分成多个文件 > [ch07-05-separating-modules-into-different-files.md](https://github.com/rust-lang/book/blob/main/src/ch07-05-separating-modules-into-different-files.md) >
diff --git a/src/ch08-01-vectors.md b/src/ch08-01-vectors.md index 372e288..002c148 100644 --- a/src/ch08-01-vectors.md +++ b/src/ch08-01-vectors.md @@ -1,4 +1,4 @@ -## vector 用来储存一系列的值 +## 使用 Vector 储存列表 > [ch08-01-vectors.md](https://github.com/rust-lang/book/blob/main/src/ch08-01-vectors.md) >
diff --git a/src/ch08-02-strings.md b/src/ch08-02-strings.md index 4880904..0ac99e2 100644 --- a/src/ch08-02-strings.md +++ b/src/ch08-02-strings.md @@ -1,4 +1,4 @@ -## 使用字符串存储 UTF-8 编码的文本 +## 使用字符串储存 UTF-8 编码的文本 > [ch08-02-strings.md](https://github.com/rust-lang/book/blob/main/src/ch08-02-strings.md) >
diff --git a/src/ch08-03-hash-maps.md b/src/ch08-03-hash-maps.md index 7745e47..2aa69ea 100644 --- a/src/ch08-03-hash-maps.md +++ b/src/ch08-03-hash-maps.md @@ -1,4 +1,4 @@ -## 哈希 map 储存键值对 +## 使用 Hash Map 储存键值对 > [ch08-03-hash-maps.md](https://github.com/rust-lang/book/blob/main/src/ch08-03-hash-maps.md) >
diff --git a/src/ch09-01-unrecoverable-errors-with-panic.md b/src/ch09-01-unrecoverable-errors-with-panic.md index 5d8eef4..a6018ef 100644 --- a/src/ch09-01-unrecoverable-errors-with-panic.md +++ b/src/ch09-01-unrecoverable-errors-with-panic.md @@ -1,4 +1,4 @@ -## `panic!` 与不可恢复的错误 +## 用 `panic!` 处理不可恢复的错误 > [ch09-01-unrecoverable-errors-with-panic.md](https://github.com/rust-lang/book/blob/main/src/ch09-01-unrecoverable-errors-with-panic.md) >
diff --git a/src/ch09-02-recoverable-errors-with-result.md b/src/ch09-02-recoverable-errors-with-result.md index 704a69a..a027c5d 100644 --- a/src/ch09-02-recoverable-errors-with-result.md +++ b/src/ch09-02-recoverable-errors-with-result.md @@ -1,4 +1,4 @@ -## `Result` 与可恢复的错误 +## 用 `Result` 处理可恢复的错误 > [ch09-02-recoverable-errors-with-result.md](https://github.com/rust-lang/book/blob/main/src/ch09-02-recoverable-errors-with-result.md) >
diff --git a/src/ch09-03-to-panic-or-not-to-panic.md b/src/ch09-03-to-panic-or-not-to-panic.md index 35861e2..89f92c9 100644 --- a/src/ch09-03-to-panic-or-not-to-panic.md +++ b/src/ch09-03-to-panic-or-not-to-panic.md @@ -1,4 +1,4 @@ -## `panic!` 还是不 `panic!` +## 要不要 `panic!` > [ch09-03-to-panic-or-not-to-panic.md](https://github.com/rust-lang/book/blob/main/src/ch09-03-to-panic-or-not-to-panic.md) >
diff --git a/src/ch10-00-generics.md b/src/ch10-00-generics.md index 44bb4c4..24a144e 100644 --- a/src/ch10-00-generics.md +++ b/src/ch10-00-generics.md @@ -1,4 +1,4 @@ -# 泛型、trait 和生命周期 +# 泛型、Trait 和生命周期 > [ch10-00-generics.md](https://github.com/rust-lang/book/blob/main/src/ch10-00-generics.md) >
diff --git a/src/ch10-02-traits.md b/src/ch10-02-traits.md index d247948..319ee4a 100644 --- a/src/ch10-02-traits.md +++ b/src/ch10-02-traits.md @@ -1,4 +1,4 @@ -## trait:定义共享的行为 +## Trait:定义共同行为 > [ch10-02-traits.md](https://github.com/rust-lang/book/blob/main/src/ch10-02-traits.md) >
diff --git a/src/ch10-03-lifetime-syntax.md b/src/ch10-03-lifetime-syntax.md index e0c9e21..f1a46ff 100644 --- a/src/ch10-03-lifetime-syntax.md +++ b/src/ch10-03-lifetime-syntax.md @@ -1,4 +1,4 @@ -## 生命周期与引用有效性 +## 生命周期确保引用有效 > [ch10-03-lifetime-syntax.md](https://github.com/rust-lang/book/blob/main/src/ch10-03-lifetime-syntax.md) >