mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2024-11-09 08:51:18 +08:00
fixed issue for CH12-01 L90, CH12-03 L82, CH12-04 L135
This commit is contained in:
parent
30056f1894
commit
e16c263fd3
@ -87,7 +87,7 @@ edited as such, can you check? -->
|
|||||||
I've hopefully cleared this up without needing to introduce repetition.
|
I've hopefully cleared this up without needing to introduce repetition.
|
||||||
/Carol-->
|
/Carol-->
|
||||||
|
|
||||||
你可能注意到了 vector 的第一个值是"target/debug/greprs",它是二进制我呢见的名称。其原因超出了本章介绍的范围,不过需要记住的是我们保存了所需的两个参数。
|
你可能注意到了 vector 的第一个值是"target/debug/greprs",它是我们二进制文件的名称。其原因超出了本章介绍的范围,不过需要记住的是我们保存了所需的两个参数。
|
||||||
|
|
||||||
### 将参数值保存进变量
|
### 将参数值保存进变量
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ currently bound together? And why does it imply that -->
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
> 注意:一些同学将这种当使用符合类型更为合适的时候使用基本类型的反模式称为**基本类型偏执**(*primitive obsession*)。
|
> 注意:一些同学将这种拒绝使用相对而言更为合适的复合类型而使用基本类型的模式称为**基本类型偏执**(*primitive obsession*)。
|
||||||
|
|
||||||
<!-- Ah, I see, so the problems here stem from using simple types to do tasks
|
<!-- Ah, I see, so the problems here stem from using simple types to do tasks
|
||||||
inefficiently, when a more complex task could handle it in ways that improve...
|
inefficiently, when a more complex task could handle it in ways that improve...
|
||||||
@ -219,7 +219,7 @@ but the index is 1', /stable-dist-rustc/build/src/libcollections/vec.rs:1307
|
|||||||
note: Run with `RUST_BACKTRACE=1` for a backtrace.
|
note: Run with `RUST_BACKTRACE=1` for a backtrace.
|
||||||
```
|
```
|
||||||
|
|
||||||
`index out of bounds: the len is 1 but the index is 1`是一个针对程序员的错误信息,这并不能真正帮助终端用户理解发生了什么和相反他们应该做什么。现在就让我们修复它吧。
|
`index out of bounds: the len is 1 but the index is 1`是一个针对程序员的错误信息,然而这并不能真正帮助终端用户理解发生了什么和他们应该做什么。现在就让我们修复它吧。
|
||||||
|
|
||||||
### 改善错误信息
|
### 改善错误信息
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ error: test failed
|
|||||||
|
|
||||||
#### 使用`lines`方法遍历每一行
|
#### 使用`lines`方法遍历每一行
|
||||||
|
|
||||||
Rust 有一个有助于一行一行遍历字符串的方法,出于方便它被成为`lines`,它如列表 12-17 这样工作:
|
Rust 有一个有助于一行一行遍历字符串的方法,出于方便它被命名为`lines`,它如列表 12-17 这样工作:
|
||||||
|
|
||||||
<span class="filename">Filename: src/lib.rs</span>
|
<span class="filename">Filename: src/lib.rs</span>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user