Merge pull request #1943 from rust-lang-cn/zh
Update Chinese translations
diff --git a/README.md b/README.md
index 829d227..b7a7dbf 100644
--- a/README.md
+++ b/README.md
@@ -61,10 +61,13 @@
[TRANSLATING_JA.md]: https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING_JA.md
+* Chinese/中文: [TRANSLATING_ZH.md]
+
+[TRANSLATING_ZH.md]: https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING_ZH.md
+
## Translations to other languages
* [Bulgarian](https://github.com/kberov/rust-by-example-bg)
-* [Chinese](https://github.com/rust-lang-cn/rust-by-example-cn)
* [French](https://github.com/Songbird0/FR_RBE)
* [Russian](https://github.com/ruRust/rust-by-example)
* [Vietnamese](https://github.com/EyesCrypto-Insights/rust-by-example-vn)
diff --git a/TRANSLATING.md b/TRANSLATING.md
index 16453bf..39f254d 100644
--- a/TRANSLATING.md
+++ b/TRANSLATING.md
@@ -43,6 +43,12 @@
msgmerge --update po/xx.po po/messages.pot
```
+#### Tracking translation progress
+
+```bash
+msgfmt --statistics po/xx.po
+```
+
### Editing translation resources
After generating a translation resource `po/xx.po`, you can write translation messages in `msgstr` entry of `po/xx.po`.
diff --git a/po/zh.po b/po/zh.po
index 866e1ba..d5c91d3 100644
--- a/po/zh.po
+++ b/po/zh.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Rust By Example\n"
-"POT-Creation-Date: 2024-08-17T09:33:02+08:00\n"
+"POT-Creation-Date: 2025-07-03T23:05:52+08:00\n"
"PO-Revision-Date: 2024-08-17 22:13+0800\n"
"Last-Translator: Binlogo <binboy@live.com>\n"
"Language-Team: Chinese\n"
@@ -190,11 +190,13 @@
msgid "Destructuring"
msgstr "解构"
-#: src/SUMMARY.md:54 src/flow_control/match/destructuring/destructure_tuple.md:1
+#: src/SUMMARY.md:54
+#: src/flow_control/match/destructuring/destructure_tuple.md:1
msgid "tuples"
msgstr "元组"
-#: src/SUMMARY.md:55 src/flow_control/match/destructuring/destructure_slice.md:1
+#: src/SUMMARY.md:55
+#: src/flow_control/match/destructuring/destructure_slice.md:1
msgid "arrays/slices"
msgstr "数组/切片"
@@ -496,7 +498,7 @@
msgid "Disambiguating overlapping traits"
msgstr "消除重叠特质的歧义"
-#: src/SUMMARY.md:148 src/macros.md:1
+#: src/SUMMARY.md:148
msgid "macro_rules!"
msgstr "macro_rules!"
@@ -779,7 +781,8 @@
"focusing on safety, speed, and concurrency. It accomplishes these goals by "
"being memory safe without using garbage collection."
msgstr ""
-"[Rust](https://www.rust-lang.org/) 是一门现代系统编程语言,专注于安全性、速度和并发性。通过内存安全而不使用垃圾回收来实现这些目标。"
+"[Rust](https://www.rust-lang.org/) 是一门现代系统编程语言,专注于安全性、速度"
+"和并发性。通过内存安全而不使用垃圾回收来实现这些目标。"
#: src/index.md:7
msgid ""
@@ -790,7 +793,11 @@
"std/). Additionally for the curious, you can also [check out the source code "
"for this site](https://github.com/rust-lang/rust-by-example)."
msgstr ""
-"《通过例子学 Rust》(Rust By Example, RBE)是一系列可运行的示例,它们展示了各种 Rust 概念和标准库。为了更好地利用这些示例,请不要忘记[本地安装 Rust](https://www.rust-lang.org/tools/install)并查看[官方文档](https://doc.rust-lang.org/)。此外,好奇的话,你也可以[查看这个网站的源代码](https://github.com/rust-lang/rust-by-example)。"
+"《通过例子学 Rust》(Rust By Example, RBE)是一系列可运行的示例,它们展示了各"
+"种 Rust 概念和标准库。为了更好地利用这些示例,请不要忘记[本地安装 Rust]"
+"(https://www.rust-lang.org/tools/install)并查看[官方文档](https://doc.rust-"
+"lang.org/)。此外,好奇的话,你也可以[查看这个网站的源代码](https://"
+"github.com/rust-lang/rust-by-example)。"
#: src/index.md:12
msgid "Now let's begin!"
@@ -804,7 +811,8 @@
msgid ""
"[Primitives](primitives.md) - Learn about signed integers, unsigned integers "
"and other primitives."
-msgstr "[Primitives](primitives.md) - 学习有符号整数、无符号整数和其他原生类型。"
+msgstr ""
+"[Primitives](primitives.md) - 学习有符号整数、无符号整数和其他原生类型。"
#: src/index.md:18
msgid "[Custom Types](custom_types.md) - `struct` and `enum`."
@@ -824,7 +832,9 @@
msgid ""
"[Conversion](conversion.md) - Convert between different types, such as "
"strings, integers, and floats."
-msgstr "[转换](conversion.md) - 在不同类型的数据之间进行转换,如字符串、整数和浮点数。"
+msgstr ""
+"[转换](conversion.md) - 在不同类型的数据之间进行转换,如字符串、整数和浮点"
+"数。"
#: src/index.md:26
msgid ""
@@ -837,7 +847,8 @@
#: src/index.md:30
msgid ""
-"[Functions](fn.md) - Learn about Methods, Closures and Higher Order Functions."
+"[Functions](fn.md) - Learn about Methods, Closures and Higher Order "
+"Functions."
msgstr "[函数](fn.md) - 学习方法、闭包和高阶函数。"
#: src/index.md:32
@@ -858,8 +869,8 @@
#: src/index.md:38
msgid ""
-"[Attributes](attribute.md) - An attribute is metadata applied to some module, "
-"crate or item."
+"[Attributes](attribute.md) - An attribute is metadata applied to some "
+"module, crate or item."
msgstr "[属性](attribute.md) - 属性是应用于某些模块、crate 或项的元数据。"
#: src/index.md:40
@@ -872,7 +883,9 @@
msgid ""
"[Scoping rules](scope.md) - Scopes play an important part in ownership, "
"borrowing, and lifetimes."
-msgstr "[作用域规则](scope.md) - 作用域在所有权(ownership)、借用(borrowing)和生命周期(lifetime)中扮演重要角色。"
+msgstr ""
+"[作用域规则](scope.md) - 作用域在所有权(ownership)、借用(borrowing)和生命"
+"周期(lifetime)中扮演重要角色。"
#: src/index.md:44
msgid ""
@@ -884,7 +897,8 @@
msgid ""
"[Macros](macros.md) - Macros are a way of writing code that writes other "
"code, which is known as metaprogramming."
-msgstr "[宏](macros.md) - 宏是一种编写代码以生成其他代码的方式,也被称为元编程。"
+msgstr ""
+"[宏](macros.md) - 宏是一种编写代码以生成其他代码的方式,也被称为元编程。"
#: src/index.md:48
msgid "[Error handling](error.md) - Learn Rust way of handling failures."
@@ -892,13 +906,14 @@
#: src/index.md:50
msgid ""
-"[Std library types](std.md) - Learn about some custom types provided by `std` "
-"library."
+"[Std library types](std.md) - Learn about some custom types provided by "
+"`std` library."
msgstr "[标准库类型](std.md) - 学习 `std` 标准库提供的一些自定义类型。"
#: src/index.md:52
msgid "[Std misc](std_misc.md) - More custom types for file handling, threads."
-msgstr "[标准库中的其他内容](std_misc.md) - 更多关于文件处理、线程的自定义类型。"
+msgstr ""
+"[标准库中的其他内容](std_misc.md) - 更多关于文件处理、线程的自定义类型。"
#: src/index.md:54
msgid "[Testing](testing.md) - All sorts of testing in Rust."
@@ -914,7 +929,8 @@
msgid ""
"[Compatibility](compatibility.md) - Handling Rust's evolution and potential "
"compatibility issues."
-msgstr "[兼容性](compatibility.md) - 应对 Rust 语言的演进及可能出现的兼容性问题。"
+msgstr ""
+"[兼容性](compatibility.md) - 应对 Rust 语言的演进及可能出现的兼容性问题。"
#: src/index.md:60
msgid "[Meta](meta.md) - Documentation, Benchmarking."
@@ -933,7 +949,7 @@
msgstr ""
"// 这是一行注释,编译器会忽略它。\n"
"// 你可以点击右侧的 \"Run\" 按钮来测试这段代码 ->\n"
-"// 如果你更习惯使用键盘,也可以使用"Ctrl + Enter"快捷键来运行。\n"
+"// 如果你更习惯使用键盘,也可以使用\"Ctrl + Enter\"快捷键来运行。\n"
#: src/hello.md:10
msgid ""
@@ -983,7 +999,8 @@
"Click 'Run' above to see the expected output. Next, add a new line with a "
"second `println!` macro so that the output shows:"
msgstr ""
-"点击上方的"运行"按钮查看预期输出。接下来,添加一行新代码,再次使用 `println!` 宏,输出显示如下内容:"
+"点击上方的\"运行\"按钮查看预期输出。接下来,添加一行新代码,再次使用 "
+"`println!` 宏,输出显示如下内容:"
#: src/hello/comment.md:3
msgid ""
@@ -1004,8 +1021,8 @@
#: src/hello/comment.md:9
msgid ""
-"_Doc comments_ which are parsed into HTML library [documentation](../meta/doc."
-"md):"
+"_Doc comments_ which are parsed into HTML library [documentation](../meta/"
+"doc.md):"
msgstr "**文档注释**:这些注释会被解析成 HTML 格式的[库文档](../meta/doc.md)"
#: src/hello/comment.md:10
@@ -1066,6 +1083,35 @@
#: src/hello/comment.md:37
msgid ""
+"// Here's another powerful use of block comments: you can uncomment\n"
+" // and comment a whole block by simply adding or removing a single\n"
+" // '/' character:\n"
+msgstr ""
+"// 这里展示块注释的另一个强大用途:你可以通过添加或删除单个\n"
+" // '/' 字符来取消注释或注释整个代码块:\n"
+
+#: src/hello/comment.md:41
+msgid ""
+"/* <- add another '/' before the 1st one to uncomment the whole block\n"
+"\n"
+" println!(\"Now\");\n"
+" println!(\"everything\");\n"
+" println!(\"executes!\");\n"
+" // line comments inside are not affected by either state\n"
+"\n"
+" // */"
+msgstr ""
+"/* <- 在第一个字符前再添加一个 '/' 来取消注释整个代码块\n"
+"\n"
+" println!(\"Now\");\n"
+" println!(\"everything\");\n"
+" println!(\"executes!\");\n"
+" // 内部的行注释不受任何状态影响\n"
+"\n"
+" // */"
+
+#: src/hello/comment.md:50
+msgid ""
"// You can manipulate expressions more easily with block comments\n"
" // than with line comments. Try deleting the comment delimiters\n"
" // to change the result:\n"
@@ -1073,20 +1119,20 @@
"// 块注释比行注释更方便地操作表达式\n"
" // 试试删除注释符号,看看结果会有什么变化:\n"
-#: src/hello/comment.md:40
+#: src/hello/comment.md:53
msgid "/* 90 + */"
msgstr "/* 90 + */"
-#: src/hello/comment.md:41
+#: src/hello/comment.md:54
msgid "\"Is `x` 10 or 100? x = {}\""
-msgstr ""`x` 是 10 还是 100?x = {}\""
+msgstr "\"`x` 是 10 还是 100?x = {}\""
-#: src/hello/comment.md:45 src/hello/print.md:103
+#: src/hello/comment.md:58 src/hello/print.md:103
#: src/hello/print/print_debug.md:75 src/hello/print/print_display.md:118
#: src/hello/print/print_display/testcase_list.md:62 src/hello/print/fmt.md:89
-#: src/primitives.md:55 src/custom_types/enum.md:100
+#: src/primitives.md:64 src/custom_types/enum.md:100
#: src/custom_types/enum/enum_use.md:45 src/custom_types/enum/c_like.md:33
-#: src/custom_types/enum/testcase_linked_list.md:77
+#: src/custom_types/enum/testcase_linked_list.md:78
#: src/custom_types/constants.md:35 src/types/alias.md:30
#: src/flow_control/for.md:121
#: src/flow_control/match/destructuring/destructure_tuple.md:25
@@ -1095,10 +1141,11 @@
#: src/flow_control/match/destructuring/destructure_pointers.md:63
#: src/flow_control/match/destructuring/destructure_structures.md:45
#: src/flow_control/match/guard.md:43 src/flow_control/match/binding.md:49
-#: src/flow_control/if_let.md:118 src/flow_control/let_else.md:57
+#: src/flow_control/if_let.md:118 src/flow_control/let_else.md:55
#: src/flow_control/while_let.md:56 src/fn/closures/capture.md:110
#: src/fn/closures/input_parameters.md:84 src/fn/closures/anonymity.md:47
-#: src/fn/closures/input_functions.md:32 src/fn/closures/output_parameters.md:49
+#: src/fn/closures/input_functions.md:32
+#: src/fn/closures/output_parameters.md:49
#: src/fn/closures/closure_examples/iter_any.md:50
#: src/fn/closures/closure_examples/iter_find.md:68
#: src/mod/struct_visibility.md:53 src/attribute/cfg.md:39 src/generics.md:59
@@ -1108,34 +1155,36 @@
#: src/generics/where.md:49 src/generics/new_types.md:54
#: src/generics/assoc_items.md:10 src/generics/assoc_items/the_problem.md:62
#: src/generics/phantom.md:56 src/generics/phantom/testcase_units.md:75
-#: src/scope/raii.md:92 src/scope/move/partial_move.md:45
+#: src/scope/raii.md:92 src/scope/move/partial_move.md:57
#: src/scope/borrow/mut.md:56 src/scope/lifetime/explicit.md:68
#: src/scope/lifetime/fn.md:58 src/scope/lifetime/methods.md:24
#: src/scope/lifetime/struct.md:41 src/scope/lifetime/trait.md:28
#: src/scope/lifetime/lifetime_bounds.md:46
-#: src/scope/lifetime/static_lifetime.md:131 src/scope/lifetime/elision.md:39
-#: src/trait/derive.md:64 src/trait/supertraits.md:40
+#: src/scope/lifetime/static_lifetime.md:133 src/scope/lifetime/elision.md:39
+#: src/trait/derive.md:65 src/trait/supertraits.md:40
#: src/trait/disambiguating.md:60 src/error/option_unwrap/map.md:79
#: src/error/option_unwrap/and_then.md:73
-#: src/error/option_unwrap/defaults.md:113 src/error/result/result_alias.md:41
+#: src/error/option_unwrap/defaults.md:115 src/error/result/result_alias.md:41
#: src/error/multiple_error_types/boxing_errors.md:57
#: src/error/multiple_error_types/reenter_question_mark.md:74
#: src/error/multiple_error_types/wrap_error.md:91 src/std.md:12
-#: src/std/rc.md:49 src/std_misc.md:12
-#: src/std_misc/threads/testcase_mapreduce.md:128 src/std_misc/path.md:54
+#: src/std/rc.md:55 src/std_misc.md:12
+#: src/std_misc/threads/testcase_mapreduce.md:129 src/std_misc/path.md:54
#: src/std_misc/fs.md:150 src/meta/doc.md:109 src/meta/playground.md:49
msgid "See also:"
msgstr "另请参阅:"
-#: src/hello/comment.md:47
+#: src/hello/comment.md:60
msgid "[Library documentation](../meta/doc.md)"
msgstr "[库文档](../meta/doc.md)"
#: src/hello/print.md:3
msgid ""
-"Printing is handled by a series of [`macros`](../macros.md) defined in [`std::"
-"fmt`](https://doc.rust-lang.org/std/fmt/) some of which are:"
-msgstr "打印功能由 [`std::fmt`](https://doc.rust-lang.org/std/fmt/) 中定义的一系列[`宏`](../macros.md)处理,其中包括:"
+"Printing is handled by a series of [`macros`](../macros.md) defined in "
+"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) some of which are:"
+msgstr ""
+"打印功能由 [`std::fmt`](https://doc.rust-lang.org/std/fmt/) 中定义的一系列[`"
+"宏`](../macros.md)处理,其中包括:"
#: src/hello/print.md:6
msgid "`format!`: write formatted text to [`String`](../std/str.md)"
@@ -1143,8 +1192,8 @@
#: src/hello/print.md:7
msgid ""
-"`print!`: same as `format!` but the text is printed to the console (io::"
-"stdout)."
+"`print!`: same as `format!` but the text is printed to the console "
+"(io::stdout)."
msgstr "`print!`:与 `format!` 类似,但文本会打印到控制台(io::stdout)"
#: src/hello/print.md:9
@@ -1165,7 +1214,8 @@
msgid ""
"All parse text in the same fashion. As a plus, Rust checks formatting "
"correctness at compile time."
-msgstr "所有这些宏都以相同的方式解析文本。此外,Rust 会在编译时检查格式化的正确性。"
+msgstr ""
+"所有这些宏都以相同的方式解析文本。此外,Rust 会在编译时检查格式化的正确性。"
#: src/hello/print.md:19
msgid ""
@@ -1194,7 +1244,7 @@
msgid "\"{0}, this is {1}. {1}, this is {0}\""
msgstr "\"{0},这是 {1}。{1},这是 {0}\""
-#: src/hello/print.md:26 src/scope/move/partial_move.md:20
+#: src/hello/print.md:26 src/scope/move/partial_move.md:31
msgid "\"Alice\""
msgstr "\"Alice\""
@@ -1266,8 +1316,8 @@
#: src/hello/print.md:41
msgid ""
"// You can right-justify text with a specified width. This will\n"
-" // output \" 1\". (Four white spaces and a \"1\", for a total width of "
-"5.)\n"
+" // output \" 1\". (Four white spaces and a \"1\", for a total width "
+"of 5.)\n"
msgstr ""
"// 可以指定宽度来右对齐文本。这将输出\n"
" // \" 1\"。(四个空格和一个 \"1\",总宽度为 5。)\n"
@@ -1303,8 +1353,7 @@
#: src/hello/print.md:50
msgid ""
"// You can use named arguments in the format specifier by appending a `$`.\n"
-msgstr ""
-"// 在格式说明符后添加 `$` 可以使用命名参数。\n"
+msgstr "// 在格式说明符后添加 `$` 可以使用命名参数。\n"
#: src/hello/print.md:51
msgid "\"{number:0>width$}\""
@@ -1369,8 +1418,9 @@
"(https://doc.rust-lang.org/std/fmt/#formatting-traits) which govern the "
"display of text. The base form of two important ones are listed below:"
msgstr ""
-"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) 包含许多控制文本显示的 [`traits`]"
-"(https://doc.rust-lang.org/std/fmt/#formatting-traits)。下面列出了两个重要的基本形式:"
+"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) 包含许多控制文本显示的 "
+"[`traits`](https://doc.rust-lang.org/std/fmt/#formatting-traits)。下面列出了"
+"两个重要的基本形式:"
#: src/hello/print.md:80
msgid ""
@@ -1385,9 +1435,12 @@
#: src/hello/print.md:84
msgid ""
-"Here, we used `fmt::Display` because the std library provides implementations "
-"for these types. To print text for custom types, more steps are required."
-msgstr "这里我们使用 `fmt::Display`,因为标准库为这些类型提供了实现。要打印自定义类型的文本,需要额外的步骤。"
+"Here, we used `fmt::Display` because the std library provides "
+"implementations for these types. To print text for custom types, more steps "
+"are required."
+msgstr ""
+"这里我们使用 `fmt::Display`,因为标准库为这些类型提供了实现。要打印自定义类型"
+"的文本,需要额外的步骤。"
#: src/hello/print.md:87
msgid ""
@@ -1396,14 +1449,17 @@
"which allows us to [convert](../conversion/string.md) the type to [`String`]"
"(../std/str.md)."
msgstr ""
-"实现 `fmt::Display` 特性会自动实现 [`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html) "
-"特性,这允许我们将该类型[转换](../conversion/string.md)为[`String`](../std/str.md)。"
+"实现 `fmt::Display` 特性会自动实现 [`ToString`](https://doc.rust-lang.org/"
+"std/string/trait.ToString.html) 特性,这允许我们将该类型[转换](../conversion/"
+"string.md)为[`String`](../std/str.md)。"
#: src/hello/print.md:90
msgid ""
"In _line 43_, `#[allow(dead_code)]` is an [attribute](../attribute.md) which "
"only applies to the module after it."
-msgstr "在 _43 行_,`#[allow(dead_code)]`是一个 [属性(attribute)](../attribute.md),它只适用于它之后的模块。"
+msgstr ""
+"在 _43 行_,`#[allow(dead_code)]`是一个 [属性(attribute)](../attribute.md),"
+"它只适用于它之后的模块。"
#: src/hello/print.md:92
msgid "Activities"
@@ -1416,21 +1472,24 @@
#: src/hello/print.md:96
msgid ""
-"Try uncommenting the line that attempts to format the `Structure` struct (see "
-"TODO)"
+"Try uncommenting the line that attempts to format the `Structure` struct "
+"(see TODO)"
msgstr "尝试取消注释那行尝试格式化 `Structure` 结构体的代码(参见 TODO 注释)"
#: src/hello/print.md:98
msgid ""
-"Add a `println!` macro call that prints: `Pi is roughly 3.142` by controlling "
-"the number of decimal places shown. For the purposes of this exercise, use "
-"`let pi = 3.141592` as an estimate for pi. (Hint: you may need to check the "
-"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) documentation for setting "
-"the number of decimals to display)"
+"Add a `println!` macro call that prints: `Pi is roughly 3.142` by "
+"controlling the number of decimal places shown. For the purposes of this "
+"exercise, use `let pi = 3.141592` as an estimate for pi. (Hint: you may need "
+"to check the [`std::fmt`](https://doc.rust-lang.org/std/fmt/) documentation "
+"for setting the number of decimals to display)"
msgstr ""
-"添加一个 `println!` 宏调用,打印:`Pi 约等于 3.142`,通过控制显示的小数位数来实现。\n"
-"在本练习中,使用 `let pi = 3.141592` 作为 pi 的近似值。(提示:你可能需要查阅\n"
-"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) 文档来了解如何设置显示的小数位数)"
+"添加一个 `println!` 宏调用,打印:`Pi 约等于 3.142`,通过控制显示的小数位数来"
+"实现。\n"
+"在本练习中,使用 `let pi = 3.141592` 作为 pi 的近似值。(提示:你可能需要查"
+"阅\n"
+"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) 文档来了解如何设置显示的小数"
+"位数)"
#: src/hello/print.md:105
msgid ""
@@ -1438,9 +1497,10 @@
"[`struct`](../custom_types/structs.md), [`traits`](https://doc.rust-lang.org/"
"std/fmt/#formatting-traits), and [`dead_code`](../attribute/unused.md)"
msgstr ""
-"[`std::fmt`](https://doc.rust-lang.org/std/fmt/)、[`macros`](../macros.md)、\n"
-"[`struct`](../custom_types/structs.md)、[`traits`](https://doc.rust-lang.org/std/fmt/#formatting-traits) "
-"和 [`dead_code`](../attribute/unused.md)"
+"[`std::fmt`](https://doc.rust-lang.org/std/fmt/)、[`macros`](../"
+"macros.md)、\n"
+"[`struct`](../custom_types/structs.md)、[`traits`](https://doc.rust-lang.org/"
+"std/fmt/#formatting-traits) 和 [`dead_code`](../attribute/unused.md)"
#: src/hello/print/print_debug.md:3
msgid ""
@@ -1458,15 +1518,15 @@
"`derive` (automatically create) the `fmt::Debug` implementation. This is not "
"true for `fmt::Display` which must be manually implemented."
msgstr ""
-"`fmt::Debug` trait 使这变得非常简单。**所有**类型都可以 `derive`(自动创建)\n"
+"`fmt::Debug` trait 使这变得非常简单。**所有**类型都可以 `derive`(自动创"
+"建)\n"
"`fmt::Debug` 实现。但这对 `fmt::Display` 不适用,后者必须手动实现。"
#: src/hello/print/print_debug.md:13
msgid ""
"// This structure cannot be printed either with `fmt::Display` or\n"
"// with `fmt::Debug`.\n"
-msgstr ""
-"// 这个结构体无法通过 `fmt::Display` 或 `fmt::Debug` 打印。\n"
+msgstr "// 这个结构体无法通过 `fmt::Display` 或 `fmt::Debug` 打印。\n"
#: src/hello/print/print_debug.md:16
msgid ""
@@ -1484,14 +1544,14 @@
"// Derive the `fmt::Debug` implementation for `Structure`. `Structure`\n"
"// is a structure which contains a single `i32`.\n"
msgstr ""
-"// 为 `Structure` 派生 `fmt::Debug` 实现。`Structure` 是一个包含单个 `i32` 的结构体。\n"
+"// 为 `Structure` 派生 `fmt::Debug` 实现。`Structure` 是一个包含单个 `i32` 的"
+"结构体。\n"
#: src/hello/print/print_debug.md:30
msgid ""
"// Put a `Structure` inside of the structure `Deep`. Make it printable\n"
"// also.\n"
-msgstr ""
-"// 在 `Deep` 结构体中放入一个 `Structure`。使其也可打印。\n"
+msgstr "// 在 `Deep` 结构体中放入一个 `Structure`。使其也可打印。\n"
#: src/hello/print/print_debug.md:37
msgid "// Printing with `{:?}` is similar to with `{}`.\n"
@@ -1535,11 +1595,11 @@
#: src/hello/print/print_debug.md:53
msgid ""
-"So `fmt::Debug` definitely makes this printable but sacrifices some elegance. "
-"Rust also provides \"pretty printing\" with `{:#?}`."
+"So `fmt::Debug` definitely makes this printable but sacrifices some "
+"elegance. Rust also provides \"pretty printing\" with `{:#?}`."
msgstr ""
"所以 `fmt::Debug` 确实使其可打印,但牺牲了一些优雅。\n"
-"Rust 还提供了使用 `{:#?}` 进行"美化打印"的功能。"
+"Rust 还提供了使用 `{:#?}` 进行\"美化打印\"的功能。"
#: src/hello/print/print_debug.md:64 src/custom_types/structs.md:42
msgid "\"Peter\""
@@ -1560,22 +1620,24 @@
#: src/hello/print/print_debug.md:77
msgid ""
"[`attributes`](https://doc.rust-lang.org/reference/attributes.html), "
-"[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/std/"
-"fmt/), and [`struct`](../../custom_types/structs.md)"
+"[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/"
+"std/fmt/), and [`struct`](../../custom_types/structs.md)"
msgstr ""
"[`attributes`](https://doc.rust-lang.org/reference/attributes.html)、\n"
-"[`derive`](../../trait/derive.md)、[`std::fmt`](https://doc.rust-lang.org/std/fmt/) \n"
+"[`derive`](../../trait/derive.md)、[`std::fmt`](https://doc.rust-lang.org/"
+"std/fmt/) \n"
"和 [`struct`](../../custom_types/structs.md)"
#: src/hello/print/print_display.md:3
msgid ""
"`fmt::Debug` hardly looks compact and clean, so it is often advantageous to "
-"customize the output appearance. This is done by manually implementing [`fmt::"
-"Display`](https://doc.rust-lang.org/std/fmt/), which uses the `{}` print "
-"marker. Implementing it looks like this:"
+"customize the output appearance. This is done by manually implementing "
+"[`fmt::Display`](https://doc.rust-lang.org/std/fmt/), which uses the `{}` "
+"print marker. Implementing it looks like this:"
msgstr ""
"`fmt::Debug` 的输出往往不够简洁清晰,因此自定义输出外观通常更有优势。\n"
-"这可以通过手动实现 [`fmt::Display`](https://doc.rust-lang.org/std/fmt/) 来完成,\n"
+"这可以通过手动实现 [`fmt::Display`](https://doc.rust-lang.org/std/fmt/) 来完"
+"成,\n"
"它使用 `{}` 打印标记。实现方式如下:"
#: src/hello/print/print_display.md:9
@@ -1594,8 +1656,7 @@
msgid ""
"// To use the `{}` marker, the trait `fmt::Display` must be implemented\n"
"// manually for the type.\n"
-msgstr ""
-"// 要使用 `{}` 标记,必须为该类型手动实现 `fmt::Display` trait。\n"
+msgstr "// 要使用 `{}` 标记,必须为该类型手动实现 `fmt::Display` trait。\n"
#: src/hello/print/print_display.md:19
msgid "// This trait requires `fmt` with this exact signature.\n"
@@ -1617,7 +1678,7 @@
#: src/hello/print/print_display/testcase_list.md:13
#: src/hello/print/print_display/testcase_list.md:39
#: src/hello/print/print_display/testcase_list.md:49 src/hello/print/fmt.md:53
-#: src/custom_types/enum/testcase_linked_list.md:73 src/conversion/string.md:25
+#: src/custom_types/enum/testcase_linked_list.md:74 src/conversion/string.md:25
#: src/flow_control/loop.md:26 src/flow_control/while.md:21
#: src/flow_control/for.md:23 src/flow_control/for.md:43 src/fn.md:40
#: src/fn/closures/capture.md:96 src/fn/closures/capture.md:97
@@ -1638,9 +1699,9 @@
"if the `std` library implemented a single style for all `Vec<T>`, what style "
"should it be? Would it be either of these two?"
msgstr ""
-"`fmt::Display` 可能比 `fmt::Debug` 更简洁,但这给 `std` 库带来了一个问题:"
-"如何显示歧义类型?例如,如果 `std` 库为所有 `Vec<T>` 实现统一的样式,"
-"应该采用哪种样式?是以下两种之一吗?"
+"`fmt::Display` 可能比 `fmt::Debug` 更简洁,但这给 `std` 库带来了一个问题:如"
+"何显示歧义类型?例如,如果 `std` 库为所有 `Vec<T>` 实现统一的样式,应该采用哪"
+"种样式?是以下两种之一吗?"
#: src/hello/print/print_display.md:35
msgid "`Vec<path>`: `/:/etc:/home/username:/bin` (split on `:`)"
@@ -1657,9 +1718,9 @@
"`Vec<T>` or for any other generic containers. `fmt::Debug` must then be used "
"for these generic cases."
msgstr ""
-"答案是否定的。因为不存在适用于所有类型的理想样式,`std` 库也不应擅自规定一种。"
-"因此,`fmt::Display` 并未为 `Vec<T>` 或其他泛型容器实现。"
-"在这些泛型情况下,必须使用 `fmt::Debug`。"
+"答案是否定的。因为不存在适用于所有类型的理想样式,`std` 库也不应擅自规定一"
+"种。因此,`fmt::Display` 并未为 `Vec<T>` 或其他泛型容器实现。在这些泛型情况"
+"下,必须使用 `fmt::Debug`。"
#: src/hello/print/print_display.md:43
msgid ""
@@ -1742,45 +1803,46 @@
#: src/hello/print/print_display.md:103
msgid ""
"So, `fmt::Display` has been implemented but `fmt::Binary` has not, and "
-"therefore cannot be used. `std::fmt` has many such [`traits`](https://doc."
-"rust-lang.org/std/fmt/#formatting-traits) and each requires its own "
+"therefore cannot be used. `std::fmt` has many such [`traits`](https://"
+"doc.rust-lang.org/std/fmt/#formatting-traits) and each requires its own "
"implementation. This is detailed further in [`std::fmt`](https://doc.rust-"
"lang.org/std/fmt/)."
msgstr ""
"因此,虽然实现了 `fmt::Display`,但未实现 `fmt::Binary`,所以无法使用。"
-"`std::fmt` 包含许多这样的[`traits`](https://doc.rust-lang.org/std/fmt/#formatting-traits),"
-"每个都需要单独实现。更多详情请参阅 [`std::fmt`](https://doc.rust-lang.org/std/fmt/)。"
+"`std::fmt` 包含许多这样的[`traits`](https://doc.rust-lang.org/std/fmt/"
+"#formatting-traits),每个都需要单独实现。更多详情请参阅 [`std::fmt`](https://"
+"doc.rust-lang.org/std/fmt/)。"
#: src/hello/print/print_display.md:109
msgid ""
-"After checking the output of the above example, use the `Point2D` struct as a "
-"guide to add a `Complex` struct to the example. When printed in the same way, "
-"the output should be:"
+"After checking the output of the above example, use the `Point2D` struct as "
+"a guide to add a `Complex` struct to the example. When printed in the same "
+"way, the output should be:"
msgstr ""
-"查看上述示例的输出后,参考 `Point2D` 结构体,向示例中添加一个 `Complex` 结构体。"
-"以相同方式打印时,输出应为:"
+"查看上述示例的输出后,参考 `Point2D` 结构体,向示例中添加一个 `Complex` 结构"
+"体。以相同方式打印时,输出应为:"
#: src/hello/print/print_display.md:120
msgid ""
-"[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/std/"
-"fmt/), [`macros`](../../macros.md), [`struct`](../../custom_types/structs."
-"md), [`trait`](https://doc.rust-lang.org/std/fmt/#formatting-traits), and "
-"[`use`](../../mod/use.md)"
+"[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/"
+"std/fmt/), [`macros`](../../macros.md), [`struct`](../../custom_types/"
+"structs.md), [`trait`](https://doc.rust-lang.org/std/fmt/#formatting-"
+"traits), and [`use`](../../mod/use.md)"
msgstr ""
-"[`derive`](../../trait/derive.md)、[`std::fmt`](https://doc.rust-lang.org/std/fmt/)、"
-"[`macros`](../../macros.md)、[`struct`](../../custom_types/structs.md)、"
-"[`trait`](https://doc.rust-lang.org/std/fmt/#formatting-traits) 和 [`use`](../../mod/use.md)"
+"[`derive`](../../trait/derive.md)、[`std::fmt`](https://doc.rust-lang.org/"
+"std/fmt/)、[`macros`](../../macros.md)、[`struct`](../../custom_types/"
+"structs.md)、[`trait`](https://doc.rust-lang.org/std/fmt/#formatting-traits) "
+"和 [`use`](../../mod/use.md)"
#: src/hello/print/print_display/testcase_list.md:3
msgid ""
"Implementing `fmt::Display` for a structure where the elements must each be "
-"handled sequentially is tricky. The problem is that each `write!` generates a "
-"`fmt::Result`. Proper handling of this requires dealing with _all_ the "
+"handled sequentially is tricky. The problem is that each `write!` generates "
+"a `fmt::Result`. Proper handling of this requires dealing with _all_ the "
"results. Rust provides the `?` operator for exactly this purpose."
msgstr ""
-"为一个需要顺序处理元素的结构体实现 `fmt::Display` 是棘手的。"
-"问题在于每个 `write!` 都会生成一个 `fmt::Result`。"
-"正确处理这种情况需要处理所有的结果。"
+"为一个需要顺序处理元素的结构体实现 `fmt::Display` 是棘手的。问题在于每个 "
+"`write!` 都会生成一个 `fmt::Result`。正确处理这种情况需要处理所有的结果。"
"Rust 提供了 `?` 运算符专门用于此目的。"
#: src/hello/print/print_display/testcase_list.md:8
@@ -1824,9 +1886,9 @@
#: src/hello/print/print_display/testcase_list.md:33
msgid ""
"// Iterate over `v` in `vec` while enumerating the iteration\n"
-" // count in `count`.\n"
+" // index in `index`.\n"
msgstr ""
-"// 遍历 `vec` 中的 `v`,同时用 `count` 记录迭代次数。\n"
+"// 遍历 `vec` 中的 `v`,同时用 `index` 枚举迭代索引。\n"
#: src/hello/print/print_display/testcase_list.md:36
msgid ""
@@ -1852,18 +1914,20 @@
msgid ""
"Try changing the program so that the index of each element in the vector is "
"also printed. The new output should look like this:"
-msgstr "尝试修改程序,使向量中每个元素的索引也被打印出来。新的输出应该如下所示:"
+msgstr ""
+"尝试修改程序,使向量中每个元素的索引也被打印出来。新的输出应该如下所示:"
#: src/hello/print/print_display/testcase_list.md:64
msgid ""
-"[`for`](../../../flow_control/for.md), [`ref`](../../../scope/borrow/ref.md), "
-"[`Result`](../../../std/result.md), [`struct`](../../../custom_types/structs."
-"md), [`?`](../../../std/result/question_mark.md), and [`vec!`](../../../std/"
-"vec.md)"
+"[`for`](../../../flow_control/for.md), [`ref`](../../../scope/borrow/"
+"ref.md), [`Result`](../../../std/result.md), [`struct`](../../../"
+"custom_types/structs.md), [`?`](../../../std/result/question_mark.md), and "
+"[`vec!`](../../../std/vec.md)"
msgstr ""
-"[`for`](../../../flow_control/for.md)、[`ref`](../../../scope/borrow/ref.md)、"
-"[`Result`](../../../std/result.md)、[`struct`](../../../custom_types/structs.md)、"
-"[`?`](../../../std/result/question_mark.md) 和 [`vec!`](../../../std/vec.md)"
+"[`for`](../../../flow_control/for.md)、[`ref`](../../../scope/borrow/"
+"ref.md)、[`Result`](../../../std/result.md)、[`struct`](../../../"
+"custom_types/structs.md)、[`?`](../../../std/result/question_mark.md) 和 "
+"[`vec!`](../../../std/vec.md)"
#: src/hello/print/fmt.md:3
msgid "We've seen that formatting is specified via a _format string_:"
@@ -1890,7 +1954,8 @@
"The same variable (`foo`) can be formatted differently depending on which "
"_argument type_ is used: `X` vs `o` vs _unspecified_."
msgstr ""
-"同一个变量(`foo`)可以根据使用的**参数类型**而有不同的格式化方式:`X`、`o` 或**未指定**。"
+"同一个变量(`foo`)可以根据使用的**参数类型**而有不同的格式化方式:`X`、`o` "
+"或**未指定**。"
#: src/hello/print/fmt.md:12
msgid ""
@@ -1899,8 +1964,8 @@
"which handles cases where the argument type is left unspecified: `{}` for "
"instance."
msgstr ""
-"这种格式化功能是通过 trait 实现的,每种参数类型都对应一个 trait。"
-"最常用的格式化 trait 是 `Display`,它处理参数类型未指定的情况,例如 `{}`。"
+"这种格式化功能是通过 trait 实现的,每种参数类型都对应一个 trait。最常用的格式"
+"化 trait 是 `Display`,它处理参数类型未指定的情况,例如 `{}`。"
#: src/hello/print/fmt.md:21
msgid "// Latitude\n"
@@ -1912,7 +1977,8 @@
#: src/hello/print/fmt.md:28
msgid ""
-"// `f` is a buffer, and this method must write the formatted string into it.\n"
+"// `f` is a buffer, and this method must write the formatted string into "
+"it.\n"
msgstr "// `f` 是一个缓冲区,此方法必须将格式化的字符串写入其中。\n"
#: src/hello/print/fmt.md:30
@@ -1959,8 +2025,7 @@
msgid ""
"// Switch this to use {} once you've added an implementation\n"
" // for fmt::Display.\n"
-msgstr ""
-"// 一旦你为 fmt::Display 添加了实现,就把这里改成使用 {}。\n"
+msgstr "// 一旦你为 fmt::Display 添加了实现,就把这里改成使用 {}。\n"
#: src/hello/print/fmt.md:62 src/primitives/tuples.md:60
#: src/custom_types/structs.md:47 src/types/inference.md:23
@@ -1973,13 +2038,13 @@
#: src/hello/print/fmt.md:67
msgid ""
-"You can view a [full list of formatting traits](https://doc.rust-lang.org/std/"
-"fmt/#formatting-traits) and their argument types in the [`std::fmt`](https://"
-"doc.rust-lang.org/std/fmt/) documentation."
+"You can view a [full list of formatting traits](https://doc.rust-lang.org/"
+"std/fmt/#formatting-traits) and their argument types in the [`std::fmt`]"
+"(https://doc.rust-lang.org/std/fmt/) documentation."
msgstr ""
-"你可以在 [`std::fmt`](https://doc.rust-lang.org/std/fmt/) 文档中查看"
-"[格式化 trait 的完整列表](https://doc.rust-lang.org/std/fmt/#formatting-traits)"
-"及其参数类型。"
+"你可以在 [`std::fmt`](https://doc.rust-lang.org/std/fmt/) 文档中查看[格式化 "
+"trait 的完整列表](https://doc.rust-lang.org/std/fmt/#formatting-traits)及其参"
+"数类型。"
#: src/hello/print/fmt.md:72
msgid ""
@@ -1998,20 +2063,25 @@
"see [RGB color format & calculation](https://www.rapidtables.com/web/color/"
"RGB_Color.html#rgb-format)."
msgstr ""
-"RGB 颜色空间中颜色的计算公式是:`RGB = (R*65536)+(G*256)+B,(其中 R 是红色,G 是绿色,B 是蓝色)`。"
-"更多信息请参见 [RGB 颜色格式和计算](https://www.rapidtables.com/web/color/RGB_Color.html#rgb-format)。"
+"RGB 颜色空间中颜色的计算公式是:`RGB = (R*65536)+(G*256)+B,(其中 R 是红色,"
+"G 是绿色,B 是蓝色)`。更多信息请参见 [RGB 颜色格式和计算](https://"
+"www.rapidtables.com/web/color/RGB_Color.html#rgb-format)。"
#: src/hello/print/fmt.md:86
msgid ""
"You [may need to list each color more than once](https://doc.rust-lang.org/"
"std/fmt/#named-parameters)."
-msgstr "你[可能需要多次列出每种颜色](https://doc.rust-lang.org/std/fmt/#named-parameters)。"
+msgstr ""
+"你[可能需要多次列出每种颜色](https://doc.rust-lang.org/std/fmt/#named-"
+"parameters)。"
#: src/hello/print/fmt.md:87
msgid ""
"You can [pad with zeros to a width of 2](https://doc.rust-lang.org/std/fmt/"
"#width) with `:0>2`."
-msgstr "你可以使用 `:0>2` [用零填充到宽度为 2](https://doc.rust-lang.org/std/fmt/#width)。"
+msgstr ""
+"你可以使用 `:0>2` [用零填充到宽度为 2](https://doc.rust-lang.org/std/fmt/"
+"#width)。"
#: src/hello/print/fmt.md:91
msgid "[`std::fmt`](https://doc.rust-lang.org/std/fmt/)"
@@ -2077,8 +2147,9 @@
"annotated via a _suffix_ or _by default_. Integers default to `i32` and "
"floats to `f64`. Note that Rust can also infer types from context."
msgstr ""
-"变量总是可以进行**类型标注**。数字还可以通过**后缀**或**默认方式**来标注。"
-"整数默认为 `i32` 类型,浮点数默认为 `f64` 类型。请注意,Rust 也可以从上下文中推断类型。"
+"变量总是可以进行**类型标注**。数字还可以通过**后缀**或**默认方式**来标注。整"
+"数默认为 `i32` 类型,浮点数默认为 `f64` 类型。请注意,Rust 也可以从上下文中推"
+"断类型。"
#: src/primitives.md:29
msgid "// Variables can be type annotated.\n"
@@ -2128,30 +2199,47 @@
msgid "// Variables can be overwritten with shadowing.\n"
msgstr "// 变量可以通过遮蔽(shadowing)来覆盖。\n"
-#: src/primitives.md:57
+#: src/primitives.md:53
+msgid "/* Compound types - Array and Tuple */"
+msgstr "/* 复合类型 - 数组和元组 */"
+
+#: src/primitives.md:55
+msgid "// Array signature consists of Type T and length as [T; length].\n"
+msgstr "// 数组的签名由类型 T 和长度组成,表示为 [T; length]。\n"
+
+#: src/primitives.md:58
+msgid ""
+"// Tuple is a collection of values of different types \n"
+" // and is constructed using parentheses ().\n"
+msgstr ""
+"// 元组是不同类型值的集合,\n"
+" // 使用圆括号 () 构造。\n"
+
+#: src/primitives.md:66
msgid ""
"[the `std` library](https://doc.rust-lang.org/std/), [`mut`]"
"(variable_bindings/mut.md), [`inference`](types/inference.md), and "
"[`shadowing`](variable_bindings/scope.md)"
msgstr ""
-"[`std` 库](https://doc.rust-lang.org/std/)、[`mut`]"
-"(variable_bindings/mut.md)、[`inference`](types/inference.md) 和 "
-"[`shadowing`](variable_bindings/scope.md)"
+"[`std` 库](https://doc.rust-lang.org/std/)、[`mut`](variable_bindings/"
+"mut.md)、[`inference`](types/inference.md) 和 [`shadowing`]"
+"(variable_bindings/scope.md)"
#: src/primitives/literals.md:3
msgid ""
"Integers `1`, floats `1.2`, characters `'a'`, strings `\"abc\"`, booleans "
"`true` and the unit type `()` can be expressed using literals."
msgstr ""
-"整数 `1`、浮点数 `1.2`、字符 `'a'`、字符串 `\"abc\"`、布尔值 `true` "
-"和单元类型 `()` 可以用字面值表示。"
+"整数 `1`、浮点数 `1.2`、字符 `'a'`、字符串 `\"abc\"`、布尔值 `true` 和单元类"
+"型 `()` 可以用字面值表示。"
#: src/primitives/literals.md:6
msgid ""
"Integers can, alternatively, be expressed using hexadecimal, octal or binary "
"notation using these prefixes respectively: `0x`, `0o` or `0b`."
msgstr ""
-"整数也可以使用十六进制、八进制或二进制表示法,分别使用这些前缀:`0x`、`0o` 或 `0b`。"
+"整数也可以使用十六进制、八进制或二进制表示法,分别使用这些前缀:`0x`、`0o` "
+"或 `0b`。"
#: src/primitives/literals.md:9
msgid ""
@@ -2164,8 +2252,8 @@
#: src/primitives/literals.md:12
msgid ""
"Rust also supports scientific [E-notation](https://en.wikipedia.org/wiki/"
-"Scientific_notation#E_notation), e.g. `1e6`, `7.6e-4`. The associated type is "
-"`f64`."
+"Scientific_notation#E_notation), e.g. `1e6`, `7.6e-4`. The associated type "
+"is `f64`."
msgstr ""
"Rust 还支持科学计数法 [E-notation](https://en.wikipedia.org/wiki/"
"Scientific_notation#E_notation),例如 `1e6`、`7.6e-4`。相关类型是 `f64`。"
@@ -2176,19 +2264,19 @@
"use the `u32` suffix to indicate that the literal is an unsigned 32-bit "
"integer, and the `i32` suffix to indicate that it's a signed 32-bit integer."
msgstr ""
-"我们需要告诉编译器我们使用的字面值的类型。现在,我们将使用 `u32` 后缀来表示该字面值是一个无符号 32 位整数,"
-"使用 `i32` 后缀来表示它是一个有符号 32 位整数。"
+"我们需要告诉编译器我们使用的字面值的类型。现在,我们将使用 `u32` 后缀来表示该"
+"字面值是一个无符号 32 位整数,使用 `i32` 后缀来表示它是一个有符号 32 位整数。"
#: src/primitives/literals.md:19
msgid ""
-"The operators available and their precedence [in Rust](https://doc.rust-lang."
-"org/reference/expressions.html#expression-precedence) are similar to other [C-"
-"like languages](https://en.wikipedia.org/wiki/"
+"The operators available and their precedence [in Rust](https://doc.rust-"
+"lang.org/reference/expressions.html#expression-precedence) are similar to "
+"other [C-like languages](https://en.wikipedia.org/wiki/"
"Operator_precedence#Programming_languages)."
msgstr ""
-"[Rust 中](https://doc.rust-lang.org/reference/expressions.html#expression-precedence)"
-"可用的运算符及其优先级与其他 [类 C 语言](https://en.wikipedia.org/wiki/"
-"Operator_precedence#Programming_languages) 类似。"
+"[Rust 中](https://doc.rust-lang.org/reference/expressions.html#expression-"
+"precedence)可用的运算符及其优先级与其他 [类 C 语言](https://en.wikipedia.org/"
+"wiki/Operator_precedence#Programming_languages) 类似。"
#: src/primitives/literals.md:24
msgid "// Integer addition\n"
@@ -2209,8 +2297,7 @@
#: src/primitives/literals.md:29
msgid ""
"// TODO ^ Try changing `1i32` to `1u32` to see why the type is important\n"
-msgstr ""
-"// TODO ^ 尝试将 `1i32` 改为 `1u32`,看看为什么类型很重要\n"
+msgstr "// TODO ^ 尝试将 `1i32` 改为 `1u32`,看看为什么类型很重要\n"
#: src/primitives/literals.md:31
msgid "// Scientific notation\n"
@@ -2272,11 +2359,13 @@
msgid ""
"A tuple is a collection of values of different types. Tuples are constructed "
"using parentheses `()`, and each tuple itself is a value with type signature "
-"`(T1, T2, ...)`, where `T1`, `T2` are the types of its members. Functions can "
-"use tuples to return multiple values, as tuples can hold any number of values."
+"`(T1, T2, ...)`, where `T1`, `T2` are the types of its members. Functions "
+"can use tuples to return multiple values, as tuples can hold any number of "
+"values."
msgstr ""
-"元组是一个可以包含各种类型的值的集合。元组使用圆括号 `()` 来构造,而且每个元组本身是一个类型标记为 "
-"`(T1, T2, ...)` 的值,其中 `T1`、`T2` 是其成员的类型。函数可以使用元组来返回多个值,因为元组可以存储任意数量的值。"
+"元组是一个可以包含各种类型的值的集合。元组使用圆括号 `()` 来构造,而且每个元"
+"组本身是一个类型标记为 `(T1, T2, ...)` 的值,其中 `T1`、`T2` 是其成员的类型。"
+"函数可以使用元组来返回多个值,因为元组可以存储任意数量的值。"
#: src/primitives/tuples.md:9
msgid "// Tuples can be used as function arguments and as return values.\n"
@@ -2414,7 +2503,8 @@
msgid ""
"An array is a collection of objects of the same type `T`, stored in "
"contiguous memory. Arrays are created using brackets `[]`, and their length, "
-"which is known at compile time, is part of their type signature `[T; length]`."
+"which is known at compile time, is part of their type signature `[T; "
+"length]`."
msgstr ""
"数组是一种存储在连续内存中的相同类型 `T` 的对象集合。\n"
"数组使用方括号 `[]` 创建,其长度在编译时已知,\n"
@@ -2540,12 +2630,13 @@
#: src/primitives/array.md:66
msgid ""
-"// Out of bound indexing on array causes compile time error.\n"
+"// Out of bound indexing on array with constant value causes compile time "
+"error.\n"
" //println!(\"{}\", xs[5]);\n"
" // Out of bound indexing on slice causes runtime error.\n"
" //println!(\"{}\", xs[..][5]);\n"
msgstr ""
-"// 对数组的越界索引会导致编译时错误。\n"
+"// 使用常量值对数组的越界索引会导致编译时错误。\n"
" //println!(\"{}\", xs[5]);\n"
" // 对切片的越界索引会导致运行时错误。\n"
" //println!(\"{}\", xs[..][5]);\n"
@@ -2580,7 +2671,9 @@
msgid ""
"The classic [C structs](https://en.wikipedia.org/wiki/"
"Struct_(C_programming_language))"
-msgstr "经典的 [C 语言风格结构体](https://en.wikipedia.org/wiki/Struct_(C_programming_language))"
+msgstr ""
+"经典的 [C 语言风格结构体](https://en.wikipedia.org/wiki/"
+"Struct_(C_programming_language))"
#: src/custom_types/structs.md:8
msgid "Unit structs, which are field-less, are useful for generics."
@@ -2645,7 +2738,8 @@
#: src/custom_types/structs.md:60
msgid ""
-"// `bottom_right.y` will be the same as `another_point.y` because we used that field\n"
+"// `bottom_right.y` will be the same as `another_point.y` because we used "
+"that field\n"
" // from `another_point`\n"
msgstr ""
"// `bottom_right.y` 与 `another_point.y` 相同,\n"
@@ -2687,14 +2781,17 @@
msgid ""
"Add a function `rect_area` which calculates the area of a `Rectangle` (try "
"using nested destructuring)."
-msgstr "添加一个 `rect_area` 函数来计算 `Rectangle` 的面积(尝试使用嵌套解构)。"
+msgstr ""
+"添加一个 `rect_area` 函数来计算 `Rectangle` 的面积(尝试使用嵌套解构)。"
#: src/custom_types/structs.md:93
msgid ""
"Add a function `square` which takes a `Point` and a `f32` as arguments, and "
"returns a `Rectangle` with its top left corner on the point, and a width and "
"height corresponding to the `f32`."
-msgstr "添加一个 `square` 函数,它接受一个 `Point` 和一个 `f32` 作为参数,返回一个 `Rectangle`,其左上角在该点上,宽度和高度都等于 `f32` 参数。"
+msgstr ""
+"添加一个 `square` 函数,它接受一个 `Point` 和一个 `f32` 作为参数,返回一个 "
+"`Rectangle`,其左上角在该点上,宽度和高度都等于 `f32` 参数。"
#: src/custom_types/structs.md:97
msgid "See also"
@@ -2703,16 +2800,20 @@
#: src/custom_types/structs.md:99
msgid ""
"[`attributes`](../attribute.md), [raw identifiers](../compatibility/"
-"raw_identifiers.md) and [destructuring](../flow_control/match/destructuring."
-"md)"
-msgstr "[`属性`](../attribute.md)、[原始标识符](../compatibility/raw_identifiers.md)和[解构](../flow_control/match/destructuring.md)"
+"raw_identifiers.md) and [destructuring](../flow_control/match/"
+"destructuring.md)"
+msgstr ""
+"[`属性`](../attribute.md)、[原始标识符](../compatibility/raw_identifiers.md)"
+"和[解构](../flow_control/match/destructuring.md)"
#: src/custom_types/enum.md:3
msgid ""
"The `enum` keyword allows the creation of a type which may be one of a few "
-"different variants. Any variant which is valid as a `struct` is also valid in "
-"an `enum`."
-msgstr "`enum` 关键字允许创建一个可能是几种不同变体之一的类型。任何作为 `struct` 有效的变体在 `enum` 中也是有效的。"
+"different variants. Any variant which is valid as a `struct` is also valid "
+"in an `enum`."
+msgstr ""
+"`enum` 关键字允许创建一个可能是几种不同变体之一的类型。任何作为 `struct` 有效"
+"的变体在 `enum` 中也是有效的。"
#: src/custom_types/enum.md:8
msgid ""
@@ -2741,8 +2842,7 @@
msgid ""
"// A function which takes a `WebEvent` enum as an argument and\n"
"// returns nothing.\n"
-msgstr ""
-"// 一个接受 `WebEvent` 枚举作为参数且不返回任何值的函数。\n"
+msgstr "// 一个接受 `WebEvent` 枚举作为参数且不返回任何值的函数。\n"
#: src/custom_types/enum.md:27
msgid "\"page loaded\""
@@ -2793,7 +2893,9 @@
"If you use a type alias, you can refer to each enum variant via its alias. "
"This might be useful if the enum's name is too long or too generic, and you "
"want to rename it."
-msgstr "使用类型别名可以通过别名引用每个枚举变体。当枚举名称过长或过于泛化,而你想重命名它时,这会很有用。"
+msgstr ""
+"使用类型别名可以通过别名引用每个枚举变体。当枚举名称过长或过于泛化,而你想重"
+"命名它时,这会很有用。"
#: src/custom_types/enum.md:67
msgid "// Creates a type alias\n"
@@ -2801,10 +2903,10 @@
#: src/custom_types/enum.md:72
msgid ""
-"// We can refer to each variant via its alias, not its long and inconvenient\n"
+"// We can refer to each variant via its alias, not its long and "
+"inconvenient\n"
" // name.\n"
-msgstr ""
-"// 我们可以通过别名引用每个变体,而不是使用又长又不便的名称。\n"
+msgstr "// 我们可以通过别名引用每个变体,而不是使用又长又不便的名称。\n"
#: src/custom_types/enum.md:78
msgid ""
@@ -2815,16 +2917,22 @@
#: src/custom_types/enum.md:96
msgid ""
"To learn more about enums and type aliases, you can read the [stabilization "
-"report](https://github.com/rust-lang/rust/pull/61682/#issuecomment-502472847) "
-"from when this feature was stabilized into Rust."
-msgstr "要了解更多关于枚举和类型别名的信息,你可以阅读这个特性被稳定到 Rust 时的[稳定化报告](https://github.com/rust-lang/rust/pull/61682/#issuecomment-502472847)。"
+"report](https://github.com/rust-lang/rust/pull/61682/"
+"#issuecomment-502472847) from when this feature was stabilized into Rust."
+msgstr ""
+"要了解更多关于枚举和类型别名的信息,你可以阅读这个特性被稳定到 Rust 时的[稳定"
+"化报告](https://github.com/rust-lang/rust/pull/61682/"
+"#issuecomment-502472847)。"
#: src/custom_types/enum.md:102
msgid ""
"[`match`](../flow_control/match.md), [`fn`](../fn.md), and [`String`](../std/"
-"str.md), [\"Type alias enum variants\" RFC](https://rust-lang.github.io/"
-"rfcs/2338-type-alias-enum-variants.html)"
-msgstr "[`match`](../flow_control/match.md)、[`fn`](../fn.md)、[`String`](../std/str.md) 和 [\"类型别名枚举变体\" RFC](https://rust-lang.github.io/rfcs/2338-type-alias-enum-variants.html)"
+"str.md), [\"Type alias enum variants\" RFC](https://rust-lang.github.io/rfcs/"
+"2338-type-alias-enum-variants.html)"
+msgstr ""
+"[`match`](../flow_control/match.md)、[`fn`](../fn.md)、[`String`](../std/"
+"str.md) 和 [\"类型别名枚举变体\" RFC](https://rust-lang.github.io/rfcs/2338-"
+"type-alias-enum-variants.html)"
#: src/custom_types/enum/enum_use.md:3
msgid "The `use` declaration can be used so manual scoping isn't needed:"
@@ -2956,36 +3064,44 @@
msgid ""
"// `self` has to be matched, because the behavior of this method\n"
" // depends on the variant of `self`\n"
-" // `self` has type `&List`, and `*self` has type `List`, matching on a\n"
+" // `self` has type `&List`, and `*self` has type `List`, matching on "
+"a\n"
" // concrete type `T` is preferred over a match on a reference `&T`\n"
-" // after Rust 2018 you can use self here and tail (with no ref) below as well,\n"
+" // after Rust 2018 you can use self here and tail (with no ref) "
+"below as well,\n"
" // rust will infer &s and ref tail. \n"
-" // See https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/default-match-bindings.html\n"
+" // See https://doc.rust-lang.org/edition-guide/rust-2018/ownership-"
+"and-lifetimes/default-match-bindings.html\n"
msgstr ""
"// 需要对 `self` 进行匹配,因为方法的行为取决于 `self` 的变体\n"
" // `self` 的类型是 `&List`,而 `*self` 的类型是 `List`\n"
" // 匹配具体类型 `T` 优于匹配引用 `&T`\n"
-" // 在 Rust 2018 版本后,这里可以直接使用 self,下面可以使用 tail(无需 ref)\n"
+" // 在 Rust 2018 版本后,这里可以直接使用 self,下面可以使用 tail(无"
+"需 ref)\n"
" // Rust 会自动推断为 &s 和 ref tail\n"
-" // 参见 https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/default-match-bindings.html\n"
+" // 参见 https://doc.rust-lang.org/edition-guide/rust-2018/ownership-"
+"and-lifetimes/default-match-bindings.html\n"
#: src/custom_types/enum/testcase_linked_list.md:39
msgid ""
"// Can't take ownership of the tail, because `self` is borrowed;\n"
" // instead take a reference to the tail\n"
+" // And it'a a non-tail recursive call which may cause stack "
+"overflow for long lists.\n"
msgstr ""
"// 无法获取 tail 的所有权,因为 `self` 是借用的;\n"
" // 所以取 tail 的引用\n"
+" // 这是一个非尾递归调用,对于长列表可能导致栈溢出。\n"
-#: src/custom_types/enum/testcase_linked_list.md:42
+#: src/custom_types/enum/testcase_linked_list.md:43
msgid "// Base Case: An empty list has zero length\n"
msgstr "// 基本情况:空链表长度为零\n"
-#: src/custom_types/enum/testcase_linked_list.md:47
+#: src/custom_types/enum/testcase_linked_list.md:48
msgid "// Return representation of the list as a (heap allocated) string\n"
msgstr "// 返回链表的字符串表示(堆分配)\n"
-#: src/custom_types/enum/testcase_linked_list.md:51
+#: src/custom_types/enum/testcase_linked_list.md:52
msgid ""
"// `format!` is similar to `print!`, but returns a heap\n"
" // allocated string instead of printing to the console\n"
@@ -2993,31 +3109,31 @@
"// `format!` 类似于 `print!`,但返回堆分配的字符串,\n"
" // 而不是打印到控制台\n"
-#: src/custom_types/enum/testcase_linked_list.md:53 src/generics/impl.md:44
+#: src/custom_types/enum/testcase_linked_list.md:54 src/generics/impl.md:44
msgid "\"{}, {}\""
msgstr "\"{}, {}\""
-#: src/custom_types/enum/testcase_linked_list.md:56
+#: src/custom_types/enum/testcase_linked_list.md:57
msgid "\"Nil\""
msgstr "\"Nil\""
-#: src/custom_types/enum/testcase_linked_list.md:63
+#: src/custom_types/enum/testcase_linked_list.md:64
msgid "// Create an empty linked list\n"
msgstr "// 创建空链表\n"
-#: src/custom_types/enum/testcase_linked_list.md:66
+#: src/custom_types/enum/testcase_linked_list.md:67
msgid "// Prepend some elements\n"
msgstr "// 在头部添加一些元素\n"
-#: src/custom_types/enum/testcase_linked_list.md:71
+#: src/custom_types/enum/testcase_linked_list.md:72
msgid "// Show the final state of the list\n"
msgstr "// 显示链表的最终状态\n"
-#: src/custom_types/enum/testcase_linked_list.md:72
+#: src/custom_types/enum/testcase_linked_list.md:73
msgid "\"linked list has length: {}\""
msgstr "\"链表长度为:{}\""
-#: src/custom_types/enum/testcase_linked_list.md:79
+#: src/custom_types/enum/testcase_linked_list.md:80
msgid "[`Box`](../../std/box.md) and [methods](../../fn/methods.md)"
msgstr "[`Box`](../../std/box.md) 和[方法](../../fn/methods.md)"
@@ -3025,7 +3141,9 @@
msgid ""
"Rust has two different types of constants which can be declared in any scope "
"including global. Both require explicit type annotation:"
-msgstr "Rust 有两种常量类型,可以在任何作用域(包括全局作用域)中声明。两者都需要显式类型标注:"
+msgstr ""
+"Rust 有两种常量类型,可以在任何作用域(包括全局作用域)中声明。两者都需要显式"
+"类型标注:"
#: src/custom_types/constants.md:6
msgid "`const`: An unchangeable value (the common case)."
@@ -3038,8 +3156,9 @@
"have to be specified. Accessing or modifying a mutable static variable is "
"[`unsafe`](../unsafe.md)."
msgstr ""
-"`static`:具有 [`'static`](../scope/lifetime/static_lifetime.md) 生命周期的可能可变变量。"
-"静态生命周期会被自动推断,无需明确指定。访问或修改可变静态变量是 [`unsafe`](../unsafe.md) 的。"
+"`static`:具有 [`'static`](../scope/lifetime/static_lifetime.md) 生命周期的可"
+"能可变变量。静态生命周期会被自动推断,无需明确指定。访问或修改可变静态变量是 "
+"[`unsafe`](../unsafe.md) 的。"
#: src/custom_types/constants.md:12
msgid "// Globals are declared outside all other scopes.\n"
@@ -3081,11 +3200,11 @@
msgid "// Error! Cannot modify a `const`.\n"
msgstr "// 错误!不能修改 `const`。\n"
-#: src/custom_types/constants.md:31 src/variable_bindings/scope.md:21
-#: src/variable_bindings/declare.md:25 src/variable_bindings/freeze.md:16
+#: src/custom_types/constants.md:31 src/variable_bindings/scope.md:22
+#: src/variable_bindings/declare.md:27 src/variable_bindings/freeze.md:16
#: src/types/cast.md:19 src/types/cast.md:28 src/flow_control/for.md:95
-#: src/scope/borrow.md:41 src/scope/borrow/mut.md:52 src/std/vec.md:31
-#: src/std/vec.md:44 src/std/hash/hashset.md:48
+#: src/scope/borrow.md:41 src/scope/borrow/mut.md:52 src/std/vec.md:32
+#: src/std/vec.md:45 src/std/hash/hashset.md:48
msgid "// FIXME ^ Comment out this line\n"
msgstr "// 修复:^ 注释掉此行\n"
@@ -3095,25 +3214,24 @@
"text/0246-const-vs-static.md), [`'static` lifetime](../scope/lifetime/"
"static_lifetime.md)"
msgstr ""
-"[`const`/`static` RFC](https://github.com/rust-lang/rfcs/blob/master/"
-"text/0246-const-vs-static.md),[`'static` 生命周期](../scope/lifetime/"
+"[`const`/`static` RFC](https://github.com/rust-lang/rfcs/blob/master/text/"
+"0246-const-vs-static.md),[`'static` 生命周期](../scope/lifetime/"
"static_lifetime.md)"
#: src/variable_bindings.md:3
msgid ""
"Rust provides type safety via static typing. Variable bindings can be type "
-"annotated when declared. However, in most cases, the compiler will be able to "
-"infer the type of the variable from the context, heavily reducing the "
+"annotated when declared. However, in most cases, the compiler will be able "
+"to infer the type of the variable from the context, heavily reducing the "
"annotation burden."
msgstr ""
-"Rust 通过静态类型提供类型安全。变量绑定在声明时可以添加类型注解。然而,在大多数情况下,"
-"编译器能够从上下文推断出变量类型,大大减少了类型注解的负担。"
+"Rust 通过静态类型提供类型安全。变量绑定在声明时可以添加类型注解。然而,在大多"
+"数情况下,编译器能够从上下文推断出变量类型,大大减少了类型注解的负担。"
#: src/variable_bindings.md:8
msgid ""
"Values (like literals) can be bound to variables, using the `let` binding."
-msgstr ""
-"可以使用 `let` 关键字将值(如字面量)绑定到变量。"
+msgstr "可以使用 `let` 关键字将值(如字面量)绑定到变量。"
#: src/variable_bindings.md:16
msgid "// copy `an_integer` into `copied_integer`\n"
@@ -3151,8 +3269,7 @@
msgid ""
"Variable bindings are immutable by default, but this can be overridden using "
"the `mut` modifier."
-msgstr ""
-"变量绑定默认是不可变的,但可以使用 `mut` 修饰符来改变这一行为。"
+msgstr "变量绑定默认是不可变的,但可以使用 `mut` 修饰符来改变这一行为。"
#: src/variable_bindings/mut.md:11
msgid "\"Before mutation: {}\""
@@ -3179,116 +3296,124 @@
"Variable bindings have a scope, and are constrained to live in a _block_. A "
"block is a collection of statements enclosed by braces `{}`."
msgstr ""
-"变量绑定有作用域,它们被限制在一个**代码块**中生存。代码块是由花括号 `{}` 包围的一系列语句。"
+"变量绑定有作用域,它们被限制在一个**代码块**中生存。代码块是由花括号 `{}` 包"
+"围的一系列语句。"
-#: src/variable_bindings/scope.md:7
+#: src/variable_bindings/scope.md:8
msgid "// This binding lives in the main function\n"
msgstr "// 这个绑定存在于 main 函数中\n"
-#: src/variable_bindings/scope.md:10
+#: src/variable_bindings/scope.md:11
msgid "// This is a block, and has a smaller scope than the main function\n"
msgstr "// 这是一个代码块,它的作用域比 main 函数小\n"
-#: src/variable_bindings/scope.md:12
+#: src/variable_bindings/scope.md:13
msgid "// This binding only exists in this block\n"
msgstr "// 这个绑定只存在于此代码块中\n"
-#: src/variable_bindings/scope.md:15
+#: src/variable_bindings/scope.md:16
msgid "\"inner short: {}\""
msgstr "\"内部 short:{}\""
-#: src/variable_bindings/scope.md:17
+#: src/variable_bindings/scope.md:18
msgid "// End of the block\n"
msgstr "// 代码块结束\n"
-#: src/variable_bindings/scope.md:19
+#: src/variable_bindings/scope.md:20
msgid "// Error! `short_lived_binding` doesn't exist in this scope\n"
msgstr "// 错误!`short_lived_binding` 在此作用域中不存在\n"
-#: src/variable_bindings/scope.md:20
+#: src/variable_bindings/scope.md:21
msgid "\"outer short: {}\""
msgstr "\"外部 short:{}\""
-#: src/variable_bindings/scope.md:23
+#: src/variable_bindings/scope.md:24
msgid "\"outer long: {}\""
msgstr "\"外部 long:{}\""
-#: src/variable_bindings/scope.md:26
+#: src/variable_bindings/scope.md:28
msgid ""
"Also, [variable shadowing](https://en.wikipedia.org/wiki/Variable_shadowing) "
"is allowed."
msgstr ""
"此外,Rust 允许[变量遮蔽](https://en.wikipedia.org/wiki/Variable_shadowing)。"
-#: src/variable_bindings/scope.md:32
+#: src/variable_bindings/scope.md:35
msgid "\"before being shadowed: {}\""
msgstr "\"被遮蔽前:{}\""
-#: src/variable_bindings/scope.md:34
+#: src/variable_bindings/scope.md:37
msgid "// This binding *shadows* the outer one\n"
msgstr "// 这个绑定*遮蔽*了外部的绑定\n"
-#: src/variable_bindings/scope.md:35
+#: src/variable_bindings/scope.md:38
msgid "\"abc\""
msgstr "\"abc\""
-#: src/variable_bindings/scope.md:37
+#: src/variable_bindings/scope.md:40
msgid "\"shadowed in inner block: {}\""
msgstr "\"内部代码块中被遮蔽:{}\""
-#: src/variable_bindings/scope.md:39
+#: src/variable_bindings/scope.md:42
msgid "\"outside inner block: {}\""
msgstr "\"内部代码块外:{}\""
-#: src/variable_bindings/scope.md:41
+#: src/variable_bindings/scope.md:44
msgid "// This binding *shadows* the previous binding\n"
msgstr "// 这个绑定*遮蔽*了之前的绑定\n"
-#: src/variable_bindings/scope.md:43
+#: src/variable_bindings/scope.md:46
msgid "\"shadowed in outer block: {}\""
msgstr "\"外部代码块中被遮蔽:{}\""
#: src/variable_bindings/declare.md:3
msgid ""
-"It's possible to declare variable bindings first, and initialize them later. "
-"However, this form is seldom used, as it may lead to the use of uninitialized "
-"variables."
+"It is possible to declare variable bindings first and initialize them later, "
+"but all variable bindings must be initialized before they are used: the "
+"compiler forbids use of uninitialized variable bindings, as it would lead to "
+"undefined behavior."
msgstr ""
-"可以先声明变量绑定,然后再初始化。但这种形式很少使用,因为它可能导致使用未初始化的变量。"
+"可以先声明变量绑定然后再初始化,但所有变量绑定在使用前必须先初始化:编译器禁"
+"止使用未初始化的变量绑定,因为这会导致未定义行为。"
-#: src/variable_bindings/declare.md:9
+#: src/variable_bindings/declare.md:5
+msgid ""
+"It is not common to declare a variable binding and initialize it later in "
+"the function. It is more difficult for a reader to find the initialization "
+"when initialization is separated from declaration. It is common to declare "
+"and initialize a variable binding near where the variable will be used."
+msgstr ""
+"在函数中先声明变量绑定而稍后再初始化的做法并不常见。当初始化与声明分离时,读"
+"者更难找到初始化的位置。更常见的做法是在变量即将使用的地方附近声明并初始化变"
+"量绑定。"
+
+#: src/variable_bindings/declare.md:11
msgid "// Declare a variable binding\n"
msgstr "// 声明一个变量绑定\n"
-#: src/variable_bindings/declare.md:15
+#: src/variable_bindings/declare.md:17
msgid "// Initialize the binding\n"
msgstr "// 初始化绑定\n"
-#: src/variable_bindings/declare.md:19
+#: src/variable_bindings/declare.md:21
msgid "\"a binding: {}\""
msgstr "\"绑定:{}\""
-#: src/variable_bindings/declare.md:23
+#: src/variable_bindings/declare.md:25
msgid "// Error! Use of uninitialized binding\n"
msgstr "// 错误!使用未初始化的绑定\n"
-#: src/variable_bindings/declare.md:24 src/variable_bindings/declare.md:29
+#: src/variable_bindings/declare.md:26 src/variable_bindings/declare.md:31
msgid "\"another binding: {}\""
msgstr "\"另一个绑定:{}\""
-#: src/variable_bindings/declare.md:33
-msgid ""
-"The compiler forbids use of uninitialized variables, as this would lead to "
-"undefined behavior."
-msgstr ""
-"编译器禁止使用未初始化的变量,因为这会导致未定义行为。"
-
#: src/variable_bindings/freeze.md:3
msgid ""
"When data is bound by the same name immutably, it also _freezes_. _Frozen_ "
"data can't be modified until the immutable binding goes out of scope:"
msgstr ""
-"当数据以相同名称被不可变地绑定时,它也会**冻结**。被冻结的数据在不可变绑定离开作用域之前不能被修改:"
+"当数据以相同名称被不可变地绑定时,它也会**冻结**。被冻结的数据在不可变绑定离"
+"开作用域之前不能被修改:"
#: src/variable_bindings/freeze.md:11
msgid "// Shadowing by immutable `_mutable_integer`\n"
@@ -3313,29 +3438,30 @@
msgstr ""
"Rust 提供了几种机制来更改或定义原生类型和用户定义类型。以下部分将介绍:"
-#: src/types.md:5
+#: src/types.md:6
msgid "[Casting](types/cast.md) between primitive types"
msgstr "原生类型之间的[类型转换](types/cast.md)"
-#: src/types.md:6
+#: src/types.md:7
msgid "Specifying the desired type of [literals](types/literals.md)"
msgstr "指定[字面量](types/literals.md)的类型"
-#: src/types.md:7
+#: src/types.md:8
msgid "Using [type inference](types/inference.md)"
msgstr "使用[类型推断](types/inference.md)"
-#: src/types.md:8
+#: src/types.md:9
msgid "[Aliasing](types/alias.md) types"
msgstr "类型[别名](types/alias.md)"
#: src/types/cast.md:3
msgid ""
-"Rust provides no implicit type conversion (coercion) between primitive types. "
-"But, explicit type conversion (casting) can be performed using the `as` "
-"keyword."
+"Rust provides no implicit type conversion (coercion) between primitive "
+"types. But, explicit type conversion (casting) can be performed using the "
+"`as` keyword."
msgstr ""
-"Rust 不支持原始类型之间的隐式类型转换(强制转换)。但可以使用 `as` 关键字进行显式类型转换(转型)。"
+"Rust 不支持原始类型之间的隐式类型转换(强制转换)。但可以使用 `as` 关键字进行"
+"显式类型转换(转型)。"
#: src/types/cast.md:6
msgid ""
@@ -3343,7 +3469,8 @@
"except in cases where C has undefined behavior. The behavior of all casts "
"between integral types is well defined in Rust."
msgstr ""
-"整数类型之间的转换规则通常遵循 C 语言惯例,但 C 中存在未定义行为的情况除外。在 Rust 中,所有整数类型之间的转换行为都有明确定义。"
+"整数类型之间的转换规则通常遵循 C 语言惯例,但 C 中存在未定义行为的情况除外。"
+"在 Rust 中,所有整数类型之间的转换行为都有明确定义。"
#: src/types/cast.md:11
msgid "// Suppress all warnings from casts which overflow.\n"
@@ -3521,15 +3648,17 @@
"example, to specify that the literal `42` should have the type `i32`, write "
"`42i32`."
msgstr ""
-"数字字面值可以通过添加类型后缀进行类型标注。例如,要指定字面值 `42` 的类型为 `i32`,可以写成 `42i32`。"
+"数字字面值可以通过添加类型后缀进行类型标注。例如,要指定字面值 `42` 的类型为 "
+"`i32`,可以写成 `42i32`。"
#: src/types/literals.md:6
msgid ""
"The type of unsuffixed numeric literals will depend on how they are used. If "
-"no constraint exists, the compiler will use `i32` for integers, and `f64` for "
-"floating-point numbers."
+"no constraint exists, the compiler will use `i32` for integers, and `f64` "
+"for floating-point numbers."
msgstr ""
-"无后缀数字字面值的类型取决于其使用方式。如果没有约束,编译器将对整数使用 `i32`,对浮点数使用 `f64`。"
+"无后缀数字字面值的类型取决于其使用方式。如果没有约束,编译器将对整数使用 "
+"`i32`,对浮点数使用 `f64`。"
#: src/types/literals.md:12
msgid "// Suffixed literals, their types are known at initialization\n"
@@ -3565,10 +3694,11 @@
#: src/types/literals.md:30
msgid ""
-"There are some concepts used in the previous code that haven't been explained "
-"yet, here's a brief explanation for the impatient readers:"
+"There are some concepts used in the previous code that haven't been "
+"explained yet, here's a brief explanation for the impatient readers:"
msgstr ""
-"前面的代码中使用了一些尚未解释的概念。为了满足迫不及待的读者,这里简要说明如下:"
+"前面的代码中使用了一些尚未解释的概念。为了满足迫不及待的读者,这里简要说明如"
+"下:"
#: src/types/literals.md:33
msgid ""
@@ -3578,22 +3708,25 @@
"is defined in the `std` _crate_. For more details, see [modules](../mod.md) "
"and [crates](../crates.md)."
msgstr ""
-"`std::mem::size_of_val` 是一个函数,这里使用了它的"完整路径"来调用。代码可以被划分为称为"模块"的逻辑单元。在这个例子中,`size_of_val` 函数定义在 `mem` 模块中,而 `mem` 模块则定义在 `std` crate 中。更多详情请参阅[模块](../mod.md)和[crate](../crates.md)。"
+"`std::mem::size_of_val` 是一个函数,这里使用了它的\"完整路径\"来调用。代码可"
+"以被划分为称为\"模块\"的逻辑单元。在这个例子中,`size_of_val` 函数定义在 "
+"`mem` 模块中,而 `mem` 模块则定义在 `std` crate 中。更多详情请参阅[模块](../"
+"mod.md)和[crate](../crates.md)。"
#: src/types/inference.md:3
msgid ""
"The type inference engine is pretty smart. It does more than looking at the "
"type of the value expression during an initialization. It also looks at how "
-"the variable is used afterwards to infer its type. Here's an advanced example "
-"of type inference:"
+"the variable is used afterwards to infer its type. Here's an advanced "
+"example of type inference:"
msgstr ""
-"类型推断引擎相当智能。它不仅在初始化时分析值表达式的类型,还会根据变量后续的使用方式来推断其类型。下面是一个类型推断的高级示例:"
+"类型推断引擎相当智能。它不仅在初始化时分析值表达式的类型,还会根据变量后续的"
+"使用方式来推断其类型。下面是一个类型推断的高级示例:"
#: src/types/inference.md:10
msgid ""
"// Because of the annotation, the compiler knows that `elem` has type u8.\n"
-msgstr ""
-"// 通过类型注解,编译器得知 `elem` 的类型为 u8 \n"
+msgstr "// 通过类型注解,编译器得知 `elem` 的类型为 u8 \n"
#: src/types/inference.md:13
msgid "// Create an empty vector (a growable array).\n"
@@ -3623,16 +3756,18 @@
msgid ""
"No type annotation of variables was needed, the compiler is happy and so is "
"the programmer!"
-msgstr ""
-"无需为变量添加类型注解,编译器和程序员都很满意!"
+msgstr "无需为变量添加类型注解,编译器和程序员都很满意!"
#: src/types/alias.md:3
msgid ""
"The `type` statement can be used to give a new name to an existing type. "
-"Types must have `UpperCamelCase` names, or the compiler will raise a warning. "
-"The exception to this rule are the primitive types: `usize`, `f32`, etc."
+"Types must have `UpperCamelCase` names, or the compiler will raise a "
+"warning. The exception to this rule are the primitive types: `usize`, `f32`, "
+"etc."
msgstr ""
-"`type` 语句用于为现有类型创建新名称。类型名必须使用 `UpperCamelCase`(大驼峰)命名,否则编译器会发出警告。此规则的例外是原始类型,如 `usize`、`f32` 等。"
+"`type` 语句用于为现有类型创建新名称。类型名必须使用 `UpperCamelCase`(大驼"
+"峰)命名,否则编译器会发出警告。此规则的例外是原始类型,如 `usize`、`f32` "
+"等。"
#: src/types/alias.md:8
msgid "// `NanoSecond`, `Inch`, and `U64` are new names for `u64`.\n"
@@ -3646,8 +3781,7 @@
msgid ""
"// Note that type aliases *don't* provide any extra type safety, because\n"
" // aliases are *not* new types\n"
-msgstr ""
-"// 注意,类型别名*不会*提供额外的类型安全性,因为别名*不是*新类型\n"
+msgstr "// 注意,类型别名*不会*提供额外的类型安全性,因为别名*不是*新类型\n"
#: src/types/alias.md:20
msgid "\"{} nanoseconds + {} inches = {} unit?\""
@@ -3655,10 +3789,11 @@
#: src/types/alias.md:27
msgid ""
-"The main use of aliases is to reduce boilerplate; for example the `io::"
-"Result<T>` type is an alias for the `Result<T, io::Error>` type."
+"The main use of aliases is to reduce boilerplate; for example the "
+"`io::Result<T>` type is an alias for the `Result<T, io::Error>` type."
msgstr ""
-"别名的主要用途是减少重复代码。例如,`io::Result<T>` 类型是 `Result<T, io::Error>` 类型的别名。"
+"别名的主要用途是减少重复代码。例如,`io::Result<T>` 类型是 `Result<T, "
+"io::Error>` 类型的别名。"
#: src/types/alias.md:32
msgid "[Attributes](../attribute.md)"
@@ -3666,21 +3801,24 @@
#: src/conversion.md:3
msgid ""
-"Primitive types can be converted to each other through [casting](types/cast."
-"md)."
-msgstr ""
-"原始类型可以通过[类型转换](types/cast.md)相互转换。"
+"Primitive types can be converted to each other through [casting](types/"
+"cast.md)."
+msgstr "原始类型可以通过[类型转换](types/cast.md)相互转换。"
#: src/conversion.md:5
msgid ""
-"Rust addresses conversion between custom types (i.e., `struct` and `enum`) by "
-"the use of [traits](trait.md). The generic conversions will use the [`From`]"
-"(https://doc.rust-lang.org/std/convert/trait.From.html) and [`Into`](https://"
-"doc.rust-lang.org/std/convert/trait.Into.html) traits. However there are more "
-"specific ones for the more common cases, in particular when converting to and "
-"from `String`s."
+"Rust addresses conversion between custom types (i.e., `struct` and `enum`) "
+"by the use of [traits](trait.md). The generic conversions will use the "
+"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html) and [`Into`]"
+"(https://doc.rust-lang.org/std/convert/trait.Into.html) traits. However "
+"there are more specific ones for the more common cases, in particular when "
+"converting to and from `String`s."
msgstr ""
-"Rust 通过使用[特质](trait.md)来处理自定义类型(如 `struct` 和 `enum`)之间的转换。通用转换使用 [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) 和 [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) 特质。然而,对于更常见的情况,特别是与 `String` 相互转换时,还有一些更具体的特质。"
+"Rust 通过使用[特质](trait.md)来处理自定义类型(如 `struct` 和 `enum`)之间的"
+"转换。通用转换使用 [`From`](https://doc.rust-lang.org/std/convert/"
+"trait.From.html) 和 [`Into`](https://doc.rust-lang.org/std/convert/"
+"trait.Into.html) 特质。然而,对于更常见的情况,特别是与 `String` 相互转换时,"
+"还有一些更具体的特质。"
#: src/conversion/from_into.md:3
msgid ""
@@ -3690,7 +3828,10 @@
"are able to convert type A from type B, then it should be easy to believe "
"that we should be able to convert type B to type A."
msgstr ""
-"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html) 和 [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) 特质本质上是相互关联的,这实际上是其实现的一部分。如果你能将类型 A 从类型 B 转换,那么我们也应该能够将类型 B 转换为类型 A。"
+"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html) 和 [`Into`]"
+"(https://doc.rust-lang.org/std/convert/trait.Into.html) 特质本质上是相互关联"
+"的,这实际上是其实现的一部分。如果你能将类型 A 从类型 B 转换,那么我们也应该"
+"能够将类型 B 转换为类型 A。"
#: src/conversion/from_into.md:7
msgid "`From`"
@@ -3700,11 +3841,13 @@
msgid ""
"The [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) trait "
"allows for a type to define how to create itself from another type, hence "
-"providing a very simple mechanism for converting between several types. There "
-"are numerous implementations of this trait within the standard library for "
-"conversion of primitive and common types."
+"providing a very simple mechanism for converting between several types. "
+"There are numerous implementations of this trait within the standard library "
+"for conversion of primitive and common types."
msgstr ""
-"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html) 特质允许一个类型定义如何从另一个类型创建自身,从而提供了一种非常简单的机制来在多种类型之间进行转换。标准库中有许多这个特质的实现,用于原始类型和常见类型的转换。"
+"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html) 特质允许一个"
+"类型定义如何从另一个类型创建自身,从而提供了一种非常简单的机制来在多种类型之"
+"间进行转换。标准库中有许多这个特质的实现,用于原始类型和常见类型的转换。"
#: src/conversion/from_into.md:14
msgid "For example we can easily convert a `str` into a `String`"
@@ -3729,7 +3872,8 @@
"simply the reciprocal of the `From` trait. It defines how to convert a type "
"into another type."
msgstr ""
-"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) 特质简单来说就是 `From` 特质的反向操作。它定义了如何将一个类型转换为另一个类型。"
+"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) 特质简单来说"
+"就是 `From` 特质的反向操作。它定义了如何将一个类型转换为另一个类型。"
#: src/conversion/from_into.md:48
msgid ""
@@ -3743,18 +3887,20 @@
msgstr "// 尝试移除类型标注\n"
#: src/conversion/from_into.md:72
-msgid "`From` and `Into` are interchangable"
+msgid "`From` and `Into` are interchangeable"
msgstr "`From` 和 `Into` 是可互换的"
#: src/conversion/from_into.md:74
msgid ""
-"`From` and `Into` are designed to be complementary. We do not need to provide "
-"an implementation for both traits. If you have implemented the `From` trait "
-"for your type, `Into` will call it when necessary. Note, however, that the "
-"converse is not true: implementing `Into` for your type will not "
-"automatically provide it with an implementation of `From`."
+"`From` and `Into` are designed to be complementary. We do not need to "
+"provide an implementation for both traits. If you have implemented the "
+"`From` trait for your type, `Into` will call it when necessary. Note, "
+"however, that the converse is not true: implementing `Into` for your type "
+"will not automatically provide it with an implementation of `From`."
msgstr ""
-"`From` 和 `Into` 被设计为互补的。我们不需要为两个特质都提供实现。如果你为你的类型实现了 `From` 特质,`Into` 会在必要时调用它。但请注意,反过来并不成立:为你的类型实现 `Into` 不会自动为它提供 `From` 的实现。"
+"`From` 和 `Into` 被设计为互补的。我们不需要为两个特质都提供实现。如果你为你的"
+"类型实现了 `From` 特质,`Into` 会在必要时调用它。但请注意,反过来并不成立:为"
+"你的类型实现 `Into` 不会自动为它提供 `From` 的实现。"
#: src/conversion/from_into.md:86
msgid "// Define `From`\n"
@@ -3773,7 +3919,9 @@
"for fallible conversions, and as such, return [`Result`](https://doc.rust-"
"lang.org/std/result/enum.Result.html)s."
msgstr ""
-"与 [`From` 和 `Into`](from_into.html) 类似,[`TryFrom`] 和 [`TryInto`] 是用于类型转换的泛型特质。与 `From`/`Into` 不同,`TryFrom`/`TryInto` 特质用于可能失败的转换,因此返回 [`Result`]。\n"
+"与 [`From` 和 `Into`](from_into.html) 类似,[`TryFrom`] 和 [`TryInto`] 是用于"
+"类型转换的泛型特质。与 `From`/`Into` 不同,`TryFrom`/`TryInto` 特质用于可能失"
+"败的转换,因此返回 [`Result`]。\n"
"\n"
"[`TryFrom`]: https://doc.rust-lang.org/std/convert/trait.TryFrom.html\n"
"[`TryInto`]: https://doc.rust-lang.org/std/convert/trait.TryInto.html\n"
@@ -3799,17 +3947,18 @@
msgid ""
"To convert any type to a `String` is as simple as implementing the "
"[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html) trait "
-"for the type. Rather than doing so directly, you should implement the [`fmt::"
-"Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html) trait which "
-"automagically provides [`ToString`](https://doc.rust-lang.org/std/string/"
-"trait.ToString.html) and also allows printing the type as discussed in the "
-"section on [`print!`](../hello/print.md)."
+"for the type. Rather than doing so directly, you should implement the "
+"[`fmt::Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html) trait "
+"which automatically provides [`ToString`](https://doc.rust-lang.org/std/"
+"string/trait.ToString.html) and also allows printing the type as discussed "
+"in the section on [`print!`](../hello/print.md)."
msgstr ""
-"要将任何类型转换为 `String`,只需为该类型实现 [`ToString`] 特质即可。但更好的做法是实现 [`fmt::Display`] 特质,它不仅会自动提供 [`ToString`],还允许打印该类型,就像在 [`print!`] 部分讨论的那样。\n"
-"\n"
-"[`ToString`]: https://doc.rust-lang.org/std/string/trait.ToString.html\n"
-"[`fmt::Display`]: https://doc.rust-lang.org/std/fmt/trait.Display.html\n"
-"[`print!`]: ../hello/print.md"
+"要将任何类型转换为 `String`,只需为该类型实现 [`ToString`](https://doc.rust-"
+"lang.org/std/string/trait.ToString.html) 特质即可。但更好的做法是实现 "
+"[`fmt::Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html) 特质,"
+"它不仅会自动提供 [`ToString`](https://doc.rust-lang.org/std/string/trait."
+"ToString.html),还允许打印该类型,就像在 [`print!`](../hello/print.md) 部分"
+"讨论的那样。"
#: src/conversion/string.md:19
msgid "\"Circle of radius {}\""
@@ -3828,7 +3977,9 @@
"inference or to specify the type to parse using the 'turbofish' syntax. Both "
"alternatives are shown in the following example."
msgstr ""
-"将字符串转换为其他类型很有用,其中最常见的操作之一是将字符串转换为数字。惯用的方法是使用 [`parse`] 函数,可以通过类型推断或使用"涡轮鱼"语法指定要解析的类型。以下示例展示了这两种方法。\n"
+"将字符串转换为其他类型很有用,其中最常见的操作之一是将字符串转换为数字。惯用"
+"的方法是使用 [`parse`] 函数,可以通过类型推断或使用\"涡轮鱼\"语法指定要解析的"
+"类型。以下示例展示了这两种方法。\n"
"\n"
"[`parse`]: https://doc.rust-lang.org/std/primitive.str.html#method.parse"
@@ -3839,7 +3990,8 @@
"implemented for that type. This is implemented for numerous types within the "
"standard library."
msgstr ""
-"只要为目标类型实现了 [`FromStr`] 特质,就可以将字符串转换为指定的类型。标准库中为许多类型实现了这个特质。\n"
+"只要为目标类型实现了 [`FromStr`] 特质,就可以将字符串转换为指定的类型。标准库"
+"中为许多类型实现了这个特质。\n"
"\n"
"[`FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html"
@@ -3891,7 +4043,8 @@
msgid ""
"There are a few kinds of statements in Rust. The most common two are "
"declaring a variable binding, and using a `;` with an expression:"
-msgstr "Rust 中有几种语句。最常见的两种是声明变量绑定,以及在表达式后使用分号 `;`:"
+msgstr ""
+"Rust 中有几种语句。最常见的两种是声明变量绑定,以及在表达式后使用分号 `;`:"
#: src/expression.md:18
msgid "// variable binding\n"
@@ -3903,13 +4056,14 @@
#: src/expression.md:28
msgid ""
-"Blocks are expressions too, so they can be used as values in assignments. The "
-"last expression in the block will be assigned to the place expression such as "
-"a local variable. However, if the last expression of the block ends with a "
-"semicolon, the return value will be `()`."
+"Blocks are expressions too, so they can be used as values in assignments. "
+"The last expression in the block will be assigned to the place expression "
+"such as a local variable. However, if the last expression of the block ends "
+"with a semicolon, the return value will be `()`."
msgstr ""
-"代码块也是表达式,因此可以在赋值中作为值使用。代码块中的最后一个表达式会被赋值给左值表达式(如局部变量)。"
-"但是,如果代码块的最后一个表达式以分号结尾,返回值将是 `()`。"
+"代码块也是表达式,因此可以在赋值中作为值使用。代码块中的最后一个表达式会被赋"
+"值给左值表达式(如局部变量)。但是,如果代码块的最后一个表达式以分号结尾,返"
+"回值将是 `()`。"
#: src/expression.md:41
msgid "// This expression will be assigned to `y`\n"
@@ -3934,20 +4088,22 @@
#: src/flow_control.md:3
msgid ""
-"An integral part of any programming language are ways to modify control flow: "
-"`if`/`else`, `for`, and others. Let's talk about them in Rust."
+"An integral part of any programming language are ways to modify control "
+"flow: `if`/`else`, `for`, and others. Let's talk about them in Rust."
msgstr ""
-"控制流是任何编程语言的重要组成部分,如 `if`/`else`、`for` 等。让我们来讨论 Rust 中的这些内容。"
+"控制流是任何编程语言的重要组成部分,如 `if`/`else`、`for` 等。让我们来讨论 "
+"Rust 中的这些内容。"
#: src/flow_control/if_else.md:3
msgid ""
"Branching with `if`\\-`else` is similar to other languages. Unlike many of "
-"them, the boolean condition doesn't need to be surrounded by parentheses, and "
-"each condition is followed by a block. `if`\\-`else` conditionals are "
+"them, the boolean condition doesn't need to be surrounded by parentheses, "
+"and each condition is followed by a block. `if`\\-`else` conditionals are "
"expressions, and, all branches must return the same type."
msgstr ""
-"`if`-`else` 分支结构与其他语言类似。不同之处在于,布尔条件不需要用括号括起来,每个条件后面都跟着一个代码块。"
-"`if`-`else` 条件是表达式,所有分支必须返回相同的类型。"
+"`if`-`else` 分支结构与其他语言类似。不同之处在于,布尔条件不需要用括号括起"
+"来,每个条件后面都跟着一个代码块。`if`-`else` 条件是表达式,所有分支必须返回"
+"相同的类型。"
#: src/flow_control/if_else.md:13
msgid "\"{} is negative\""
@@ -4000,7 +4156,8 @@
"`continue` statement can be used to skip the rest of the iteration and start "
"a new one."
msgstr ""
-"`break` 语句可以随时退出循环,而 `continue` 语句可以跳过当前迭代的剩余部分并开始下一次迭代。"
+"`break` 语句可以随时退出循环,而 `continue` 语句可以跳过当前迭代的剩余部分并"
+"开始下一次迭代。"
#: src/flow_control/loop.md:13
msgid "\"Let's count until infinity!\""
@@ -4032,8 +4189,8 @@
"loops. In these cases, the loops must be annotated with some `'label`, and "
"the label must be passed to the `break`/`continue` statement."
msgstr ""
-"在处理嵌套循环时,可以 `break` 或 `continue` 外层循环。这种情况下,循环必须用 `'label` 标记,"
-"并且必须将标签传递给 `break`/`continue` 语句。"
+"在处理嵌套循环时,可以 `break` 或 `continue` 外层循环。这种情况下,循环必须"
+"用 `'label` 标记,并且必须将标签传递给 `break`/`continue` 语句。"
#: src/flow_control/loop/nested.md:12
msgid "\"Entered the outer loop\""
@@ -4070,18 +4227,21 @@
"of the code: put it after the `break`, and it will be returned by the `loop` "
"expression."
msgstr ""
-"`loop` 的一个用途是重试操作直到成功。如果操作返回一个值,你可能需要将它传递给代码的其余部分:"
-"将它放在 `break` 之后,它将被 `loop` 表达式返回。"
+"`loop` 的一个用途是重试操作直到成功。如果操作返回一个值,你可能需要将它传递给"
+"代码的其余部分:将它放在 `break` 之后,它将被 `loop` 表达式返回。"
#: src/flow_control/while.md:3
-msgid "The `while` keyword can be used to run a loop while a condition is true."
+msgid ""
+"The `while` keyword can be used to run a loop while a condition is true."
msgstr "`while` 关键字用于在条件为真时运行循环。"
#: src/flow_control/while.md:5
msgid ""
"Let's write the infamous [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) "
"using a `while` loop."
-msgstr "让我们用 `while` 循环来编写著名的 [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) 程序。"
+msgstr ""
+"让我们用 `while` 循环来编写著名的 [FizzBuzz](https://en.wikipedia.org/wiki/"
+"Fizz_buzz) 程序。"
#: src/flow_control/while.md:9
msgid "// A counter variable\n"
@@ -4120,8 +4280,8 @@
"the easiest ways to create an iterator is to use the range notation `a..b`. "
"This yields values from `a` (inclusive) to `b` (exclusive) in steps of one."
msgstr ""
-"`for in` 结构可用于遍历 `Iterator`。创建迭代器最简单的方法之一是使用区间表示法 `a..b`。"
-"这会生成从 `a`(包含)到 `b`(不包含)的值,步长为 1。"
+"`for in` 结构可用于遍历 `Iterator`。创建迭代器最简单的方法之一是使用区间表示"
+"法 `a..b`。这会生成从 `a`(包含)到 `b`(不包含)的值,步长为 1。"
#: src/flow_control/for.md:10
msgid "Let's write FizzBuzz using `for` instead of `while`."
@@ -4149,9 +4309,9 @@
"collection. However, this is not the only means of converting collections "
"into iterators."
msgstr ""
-"`for in` 结构能以多种方式与 `Iterator` 交互。正如在 [Iterator](../trait/iter.md) "
-"特质一节中讨论的那样,默认情况下 `for` 循环会对集合应用 `into_iter` 函数。"
-"然而,这并不是将集合转换为迭代器的唯一方法。"
+"`for in` 结构能以多种方式与 `Iterator` 交互。正如在 [Iterator](../trait/"
+"iter.md) 特质一节中讨论的那样,默认情况下 `for` 循环会对集合应用 `into_iter` "
+"函数。然而,这并不是将集合转换为迭代器的唯一方法。"
#: src/flow_control/for.md:56
msgid ""
@@ -4159,16 +4319,16 @@
"into an iterator in different ways, by providing different views on the data "
"within."
msgstr ""
-"`into_iter`、`iter` 和 `iter_mut` 都以不同的方式处理集合到迭代器的转换,"
-"通过提供对数据的不同视图。"
+"`into_iter`、`iter` 和 `iter_mut` 都以不同的方式处理集合到迭代器的转换,通过"
+"提供对数据的不同视图。"
#: src/flow_control/for.md:60
msgid ""
"`iter` - This borrows each element of the collection through each iteration. "
"Thus leaving the collection untouched and available for reuse after the loop."
msgstr ""
-"`iter` - 在每次迭代中借用集合的每个元素。"
-"因此,集合保持不变,并且在循环之后可以重复使用。"
+"`iter` - 在每次迭代中借用集合的每个元素。因此,集合保持不变,并且在循环之后可"
+"以重复使用。"
#: src/flow_control/for.md:65 src/flow_control/for.md:85
#: src/flow_control/for.md:104
@@ -4202,18 +4362,17 @@
#: src/flow_control/for.md:79
msgid ""
"`into_iter` - This consumes the collection so that on each iteration the "
-"exact data is provided. Once the collection has been consumed it is no longer "
-"available for reuse as it has been 'moved' within the loop."
+"exact data is provided. Once the collection has been consumed it is no "
+"longer available for reuse as it has been 'moved' within the loop."
msgstr ""
-"`into_iter` - 这会消耗集合,使得在每次迭代中提供确切的数据。"
-"一旦集合被消耗,它就不再可用于重复使用,因为它已经在循环中被"移动"了。"
+"`into_iter` - 这会消耗集合,使得在每次迭代中提供确切的数据。一旦集合被消耗,"
+"它就不再可用于重复使用,因为它已经在循环中被\"移动\"了。"
#: src/flow_control/for.md:99
msgid ""
"`iter_mut` - This mutably borrows each element of the collection, allowing "
"for the collection to be modified in place."
-msgstr ""
-"`iter_mut` - 这会可变地借用集合的每个元素,允许在原地修改集合。"
+msgstr "`iter_mut` - 这会可变地借用集合的每个元素,允许在原地修改集合。"
#: src/flow_control/for.md:109
msgid "\"Hello\""
@@ -4225,8 +4384,8 @@
"difference in the types of iteration. The difference in type then of course "
"implies differing actions that are able to be performed."
msgstr ""
-"在上面的代码片段中,注意 `match` 分支的类型,这是迭代类型的关键区别。"
-"类型的差异意味着可以执行不同的操作。"
+"在上面的代码片段中,注意 `match` 分支的类型,这是迭代类型的关键区别。类型的差"
+"异意味着可以执行不同的操作。"
#: src/flow_control/for.md:123
msgid "[Iterator](../trait/iter.md)"
@@ -4238,8 +4397,8 @@
"like a C `switch`. The first matching arm is evaluated and all possible "
"values must be covered."
msgstr ""
-"Rust 通过 `match` 关键字提供模式匹配,类似于 C 语言的 `switch`。"
-"第一个匹配的分支会被求值,并且必须覆盖所有可能的值。"
+"Rust 通过 `match` 关键字提供模式匹配,类似于 C 语言的 `switch`。第一个匹配的"
+"分支会被求值,并且必须覆盖所有可能的值。"
#: src/flow_control/match.md:10
msgid "// TODO ^ Try different values for `number`\n"
@@ -4386,7 +4545,8 @@
msgstr "// 尝试改变数组中的值,或将其变成切片!\n"
#: src/flow_control/match/destructuring/destructure_slice.md:11
-msgid "// Binds the second and the third elements to the respective variables\n"
+msgid ""
+"// Binds the second and the third elements to the respective variables\n"
msgstr "// 将第二个和第三个元素分别绑定到相应的变量\n"
#: src/flow_control/match/destructuring/destructure_slice.md:13
@@ -4443,10 +4603,11 @@
#: src/flow_control/match/destructuring/destructure_slice.md:48
msgid ""
-"[Arrays and Slices](../../../primitives/array.md) and [Binding](../binding."
-"md) for `@` sigil"
+"[Arrays and Slices](../../../primitives/array.md) and [Binding](../"
+"binding.md) for `@` sigil"
msgstr ""
-"关于 `@` 符号的更多信息,请参阅[数组和切片](../../../primitives/array.md)和[绑定](../binding.md)"
+"关于 `@` 符号的更多信息,请参阅[数组和切片](../../../primitives/array.md)和"
+"[绑定](../binding.md)"
#: src/flow_control/match/destructuring/destructure_enum.md:3
msgid "An `enum` is destructured similarly:"
@@ -4456,8 +4617,7 @@
msgid ""
"// `allow` required to silence warnings because only\n"
"// one variant is used.\n"
-msgstr ""
-"// 使用 `allow` 来抑制警告,因为只使用了一个变体。\n"
+msgstr "// 使用 `allow` 来抑制警告,因为只使用了一个变体。\n"
#: src/flow_control/match/destructuring/destructure_enum.md:10
msgid "// These 3 are specified solely by their name.\n"
@@ -4517,11 +4677,12 @@
#: src/flow_control/match/destructuring/destructure_enum.md:50
msgid ""
-"[`#[allow(...)]`](../../../attribute/unused.md), [color models](https://en."
-"wikipedia.org/wiki/Color_model) and [`enum`](../../../custom_types/enum.md)"
+"[`#[allow(...)]`](../../../attribute/unused.md), [color models](https://"
+"en.wikipedia.org/wiki/Color_model) and [`enum`](../../../custom_types/"
+"enum.md)"
msgstr ""
-"[`#[allow(...)]`](../../../attribute/unused.md)、[颜色模型](https://en."
-"wikipedia.org/wiki/Color_model)和[`enum`](../../../custom_types/enum.md)"
+"[`#[allow(...)]`](../../../attribute/unused.md)、[颜色模型](https://"
+"en.wikipedia.org/wiki/Color_model)和[`enum`](../../../custom_types/enum.md)"
#: src/flow_control/match/destructuring/destructure_pointers.md:3
msgid ""
@@ -4529,7 +4690,8 @@
"dereferencing as they are different concepts which are used differently from "
"languages like C/C++."
msgstr ""
-"对于指针,需要区分解构和解引用,因为它们是不同的概念,其用法与 C/C++ 等语言不同。"
+"对于指针,需要区分解构和解引用,因为它们是不同的概念,其用法与 C/C++ 等语言不"
+"同。"
#: src/flow_control/match/destructuring/destructure_pointers.md:7
msgid "Dereferencing uses `*`"
@@ -4721,8 +4883,8 @@
#: src/flow_control/match/guard.md:27
msgid ""
-"Note that the compiler won't take guard conditions into account when checking "
-"if all patterns are covered by the match expression."
+"Note that the compiler won't take guard conditions into account when "
+"checking if all patterns are covered by the match expression."
msgstr ""
"注意,编译器在检查 match 表达式是否涵盖了所有模式时,不会考虑守卫条件。"
@@ -4743,7 +4905,8 @@
" // TODO ^ 取消注释以修复编译错误\n"
#: src/flow_control/match/guard.md:45
-msgid "[Tuples](../../primitives/tuples.md) [Enums](../../custom_types/enum.md)"
+msgid ""
+"[Tuples](../../primitives/tuples.md) [Enums](../../custom_types/enum.md)"
msgstr "[元组](../../primitives/tuples.md) [枚举](../../custom_types/enum.md)"
#: src/flow_control/match/binding.md:3
@@ -4752,7 +4915,8 @@
"variable without re-binding. `match` provides the `@` sigil for binding "
"values to names:"
msgstr ""
-"间接访问变量时,无法在分支中使用该变量而不重新绑定。`match` 提供了 `@` 符号,用于将值绑定到名称:"
+"间接访问变量时,无法在分支中使用该变量而不重新绑定。`match` 提供了 `@` 符号,"
+"用于将值绑定到名称:"
#: src/flow_control/match/binding.md:8
msgid "// A function `age` which returns a `u32`.\n"
@@ -4794,15 +4958,15 @@
#: src/flow_control/match/binding.md:29
msgid ""
-"You can also use binding to \"destructure\" `enum` variants, such as `Option`:"
-msgstr "你也可以使用绑定来"解构" `enum` 变体,例如 `Option`:"
+"You can also use binding to \"destructure\" `enum` variants, such as "
+"`Option`:"
+msgstr "你也可以使用绑定来\"解构\" `enum` 变体,例如 `Option`:"
#: src/flow_control/match/binding.md:38
msgid ""
"// Got `Some` variant, match if its value, bound to `n`,\n"
" // is equal to 42.\n"
-msgstr ""
-"// 获得 `Some` 变体,检查其值(绑定到 `n`)是否等于 42\n"
+msgstr "// 获得 `Some` 变体,检查其值(绑定到 `n`)是否等于 42\n"
#: src/flow_control/match/binding.md:40
msgid "\"The Answer: {}!\""
@@ -4820,19 +4984,18 @@
msgid "// Match anything else (`None` variant).\n"
msgstr "// 匹配其他任何情况(`None` 变体)\n"
-#: src/flow_control/match/binding.md:50
+#: src/flow_control/match/binding.md:51
msgid ""
"[`functions`](../../fn.md), [`enums`](../../custom_types/enum.md) and "
"[`Option`](../../std/option.md)"
msgstr ""
-"[`函数`](../../fn.md)、[`枚举`](../../custom_types/enum.md) 和 "
-"[`Option`](../../std/option.md)"
+"[`函数`](../../fn.md)、[`枚举`](../../custom_types/enum.md) 和 [`Option`]"
+"(../../std/option.md)"
#: src/flow_control/if_let.md:3
msgid ""
"For some use cases, when matching enums, `match` is awkward. For example:"
-msgstr ""
-"在某些情况下,使用 `match` 匹配枚举可能会显得繁琐。例如:"
+msgstr "在某些情况下,使用 `match` 匹配枚举可能会显得繁琐。例如:"
#: src/flow_control/if_let.md:6 src/flow_control/while_let.md:7
#: src/flow_control/while_let.md:35
@@ -4855,8 +5018,7 @@
msgid ""
"`if let` is cleaner for this use case and in addition allows various failure "
"options to be specified:"
-msgstr ""
-"对于这种情况,`if let` 更加简洁,而且还允许指定各种失败时的处理选项:"
+msgstr "对于这种情况,`if let` 更加简洁,而且还允许指定各种失败时的处理选项:"
#: src/flow_control/if_let.md:23
msgid "// All have type `Option<i32>`\n"
@@ -4895,8 +5057,7 @@
msgid ""
"// Destructure failed. Evaluate an `else if` condition to see if the\n"
" // alternate failure branch should be taken:\n"
-msgstr ""
-"// 解构失败。评估 `else if` 条件,看是否应该执行替代的失败分支:\n"
+msgstr "// 解构失败。评估 `else if` 条件,看是否应该执行替代的失败分支:\n"
#: src/flow_control/if_let.md:52
msgid "// The condition evaluated false. This branch is the default:\n"
@@ -4966,7 +5127,9 @@
"because instances of the enum cannot be equated, however `if let` will "
"continue to work."
msgstr ""
-"`if let` 的另一个优点是它允许我们匹配非参数化的枚举变体。即使在枚举没有实现或派生 `PartialEq` 的情况下也是如此。在这种情况下,`if Foo::Bar == a` 将无法编译,因为枚举的实例无法进行相等比较,但 `if let` 仍然可以正常工作。"
+"`if let` 的另一个优点是它允许我们匹配非参数化的枚举变体。即使在枚举没有实现或"
+"派生 `PartialEq` 的情况下也是如此。在这种情况下,`if Foo::Bar == a` 将无法编"
+"译,因为枚举的实例无法进行相等比较,但 `if let` 仍然可以正常工作。"
#: src/flow_control/if_let.md:100
msgid "Would you like a challenge? Fix the following example to use `if let`:"
@@ -4986,63 +5149,62 @@
#: src/flow_control/if_let.md:120
msgid ""
-"[`enum`](../custom_types/enum.md), [`Option`](../std/option.md), and the [RFC]"
-"(https://github.com/rust-lang/rfcs/pull/160)"
+"[`enum`](../custom_types/enum.md), [`Option`](../std/option.md), and the "
+"[RFC](https://github.com/rust-lang/rfcs/pull/160)"
msgstr ""
"[`枚举`](../custom_types/enum.md)、[`Option`](../std/option.md) 和 [RFC]"
"(https://github.com/rust-lang/rfcs/pull/160)"
-#: src/flow_control/let_else.md:4
+#: src/flow_control/let_else.md:3
msgid "🛈 stable since: rust 1.65"
msgstr "🛈 自 Rust 1.65 版本起稳定"
-#: src/flow_control/let_else.md:6
+#: src/flow_control/let_else.md:5
msgid ""
"🛈 you can target specific edition by compiling like this `rustc --"
"edition=2021 main.rs`"
-msgstr ""
-"🛈 你可以通过这种方式编译来指定特定版本:`rustc --edition=2021 main.rs`"
+msgstr "🛈 你可以通过这种方式编译来指定特定版本:`rustc --edition=2021 main.rs`"
-#: src/flow_control/let_else.md:10
+#: src/flow_control/let_else.md:8
msgid ""
"With `let`\\-`else`, a refutable pattern can match and bind variables in the "
"surrounding scope like a normal `let`, or else diverge (e.g. `break`, "
"`return`, `panic!`) when the pattern doesn't match."
msgstr ""
-"`let`-`else` 语法允许可能失败的模式匹配像普通 `let` 一样绑定变量到当前作用域,"
-"或在匹配失败时执行中断操作(如 `break`、`return`、`panic!`)。"
+"`let`-`else` 语法允许可能失败的模式匹配像普通 `let` 一样绑定变量到当前作用"
+"域,或在匹配失败时执行中断操作(如 `break`、`return`、`panic!`)。"
-#: src/flow_control/let_else.md:18 src/flow_control/let_else.md:41
+#: src/flow_control/let_else.md:16 src/flow_control/let_else.md:39
#: src/std/str.md:41
msgid "' '"
msgstr "' '"
-#: src/flow_control/let_else.md:20 src/flow_control/let_else.md:44
+#: src/flow_control/let_else.md:18 src/flow_control/let_else.md:42
msgid "\"Can't segment count item pair: '{s}'\""
msgstr "\"无法分割计数项对:'{s}'\""
-#: src/flow_control/let_else.md:23 src/flow_control/let_else.md:49
+#: src/flow_control/let_else.md:21 src/flow_control/let_else.md:47
msgid "\"Can't parse integer: '{count_str}'\""
msgstr "\"无法解析整数:'{count_str}'\""
-#: src/flow_control/let_else.md:29 src/flow_control/let_else.md:54
+#: src/flow_control/let_else.md:27 src/flow_control/let_else.md:52
msgid "\"3 chairs\""
msgstr "\"3 chairs\""
-#: src/flow_control/let_else.md:29 src/flow_control/let_else.md:54
+#: src/flow_control/let_else.md:27 src/flow_control/let_else.md:52
msgid "\"chairs\""
msgstr "\"chairs\""
-#: src/flow_control/let_else.md:33
+#: src/flow_control/let_else.md:31
msgid ""
"The scope of name bindings is the main thing that makes this different from "
"`match` or `if let`\\-`else` expressions. You could previously approximate "
"these patterns with an unfortunate bit of repetition and an outer `let`:"
msgstr ""
-"名称绑定的作用域是使其区别于 `match` 或 `if let`-`else` 表达式的主要特点。"
-"在此之前,你可能需要通过一些冗余的重复和外部 `let` 来近似实现这些模式:"
+"名称绑定的作用域是使其区别于 `match` 或 `if let`-`else` 表达式的主要特点。在"
+"此之前,你可能需要通过一些冗余的重复和外部 `let` 来近似实现这些模式:"
-#: src/flow_control/let_else.md:59
+#: src/flow_control/let_else.md:57
msgid ""
"[option](../std/option.md), [match](./match.md), [if let](./if_let.md) and "
"the [let-else RFC](https://rust-lang.github.io/rfcs/3137-let-else.html)."
@@ -5055,8 +5217,8 @@
"Similar to `if let`, `while let` can make awkward `match` sequences more "
"tolerable. Consider the following sequence that increments `i`:"
msgstr ""
-"与 `if let` 类似,`while let` 可以简化繁琐的 `match` 序列。"
-"让我们来看一个递增 `i` 的例子:"
+"与 `if let` 类似,`while let` 可以简化繁琐的 `match` 序列。让我们来看一个递"
+"增 `i` 的例子:"
#: src/flow_control/while_let.md:9
msgid "// Repeatedly try this test.\n"
@@ -5102,8 +5264,7 @@
msgid ""
"// ^ Less rightward drift and doesn't require\n"
" // explicitly handling the failing case.\n"
-msgstr ""
-"// ^ 减少了代码缩进右移,无需显式处理失败情况\n"
+msgstr "// ^ 减少了代码缩进右移,无需显式处理失败情况\n"
#: src/flow_control/while_let.md:51
msgid ""
@@ -5114,8 +5275,8 @@
#: src/flow_control/while_let.md:58
msgid ""
-"[`enum`](../custom_types/enum.md), [`Option`](../std/option.md), and the [RFC]"
-"(https://github.com/rust-lang/rfcs/pull/214)"
+"[`enum`](../custom_types/enum.md), [`Option`](../std/option.md), and the "
+"[RFC](https://github.com/rust-lang/rfcs/pull/214)"
msgstr ""
"[`enum`](../custom_types/enum.md)、[`Option`](../std/option.md) 和 [RFC]"
"(https://github.com/rust-lang/rfcs/pull/214)"
@@ -5126,8 +5287,8 @@
"annotated, just like variables, and, if the function returns a value, the "
"return type must be specified after an arrow `->`."
msgstr ""
-"函数使用 `fn` 关键字声明。函数参数需要标注类型,就像变量一样。"
-"如果函数返回值,则必须在箭头 `->` 后指定返回类型。"
+"函数使用 `fn` 关键字声明。函数参数需要标注类型,就像变量一样。如果函数返回"
+"值,则必须在箭头 `->` 后指定返回类型。"
#: src/fn.md:7
msgid ""
@@ -5135,8 +5296,8 @@
"Alternatively, the `return` statement can be used to return a value earlier "
"from within the function, even from inside loops or `if` statements."
msgstr ""
-"函数的最后一个表达式将作为返回值。另外,可以使用 `return` 语句在函数内部提前返回值,"
-"甚至可以在循环或 `if` 语句内部使用。"
+"函数的最后一个表达式将作为返回值。另外,可以使用 `return` 语句在函数内部提前"
+"返回值,甚至可以在循环或 `if` 语句内部使用。"
#: src/fn.md:11
msgid "Let's rewrite FizzBuzz using functions!"
@@ -5144,9 +5305,9 @@
#: src/fn.md:14
msgid ""
-"// Unlike C/C++, there's no restriction on the order of function definitions\n"
-msgstr ""
-"// 与 C/C++ 不同,Rust 中函数定义的顺序没有限制\n"
+"// Unlike C/C++, there's no restriction on the order of function "
+"definitions\n"
+msgstr "// 与 C/C++ 不同,Rust 中函数定义的顺序没有限制\n"
#: src/fn.md:16
msgid "// We can use this function here, and define it somewhere later\n"
@@ -5168,15 +5329,13 @@
msgid ""
"// Functions that \"don't\" return a value, actually return the unit type "
"`()`\n"
-msgstr ""
-"// \"无返回值\"的函数实际上返回单元类型 `()`\n"
+msgstr "// \"无返回值\"的函数实际上返回单元类型 `()`\n"
#: src/fn.md:43
msgid ""
"// When a function returns `()`, the return type can be omitted from the\n"
"// signature\n"
-msgstr ""
-"// 当函数返回 `()` 时,可以在函数签名中省略返回类型\n"
+msgstr "// 当函数返回 `()` 时,可以在函数签名中省略返回类型\n"
#: src/fn/methods.md:1
msgid "Associated functions & Methods"
@@ -5189,15 +5348,14 @@
"are defined on a type generally, while methods are associated functions that "
"are called on a particular instance of a type."
msgstr ""
-"某些函数与特定类型相关联。这些函数有两种形式:关联函数和方法。"
-"关联函数是在类型上定义的函数,而方法是在类型的特定实例上调用的关联函数。"
+"某些函数与特定类型相关联。这些函数有两种形式:关联函数和方法。关联函数是在类"
+"型上定义的函数,而方法是在类型的特定实例上调用的关联函数。"
#: src/fn/methods.md:13
msgid ""
"// Implementation block, all `Point` associated functions & methods go in "
"here\n"
-msgstr ""
-"// 实现块,所有 `Point` 的关联函数和方法都在此处定义\n"
+msgstr "// 实现块,所有 `Point` 的关联函数和方法都在此处定义\n"
#: src/fn/methods.md:16
msgid ""
@@ -5208,7 +5366,7 @@
" // Associated functions don't need to be called with an instance.\n"
" // These functions are generally used like constructors.\n"
msgstr ""
-"// 这是一个"关联函数",因为这个函数与特定类型 Point 相关联。\n"
+"// 这是一个\"关联函数\",因为这个函数与特定类型 Point 相关联。\n"
" //\n"
" // 关联函数不需要通过实例来调用。\n"
" // 这些函数通常用作构造函数。\n"
@@ -5235,8 +5393,7 @@
msgid ""
"// `abs` is a `f64` method that returns the absolute value of the\n"
" // caller\n"
-msgstr ""
-"// `abs` 是 `f64` 类型的方法,返回调用者的绝对值\n"
+msgstr "// `abs` 是 `f64` 类型的方法,返回调用者的绝对值\n"
#: src/fn/methods.md:57
msgid ""
@@ -5255,7 +5412,7 @@
"// This method \"consumes\" the resources of the caller object\n"
" // `self` desugars to `self: Self`\n"
msgstr ""
-"// 这个方法会"消耗"调用对象的资源\n"
+"// 这个方法会\"消耗\"调用对象的资源\n"
" // `self` 是 `self: Self` 的语法糖\n"
#: src/fn/methods.md:75
@@ -5313,7 +5470,7 @@
" //pair.destroy();\n"
" // TODO ^ Try uncommenting this line\n"
msgstr ""
-"// 报错!之前的 `destroy` 调用已经"消耗"了 `pair`\n"
+"// 报错!之前的 `destroy` 调用已经\"消耗\"了 `pair`\n"
" //pair.destroy();\n"
" // TODO ^ 尝试取消注释这一行\n"
@@ -5327,30 +5484,31 @@
msgid ""
"The syntax and capabilities of closures make them very convenient for on the "
"fly usage. Calling a closure is exactly like calling a function. However, "
-"both input and return types _can_ be inferred and input variable names _must_ "
-"be specified."
+"both input and return types _can_ be inferred and input variable names "
+"_must_ be specified."
msgstr ""
-"闭包的语法和功能使其非常适合即时使用。调用闭包与调用函数完全相同。不过,闭包的输入和返回类型**可以**被推断,而输入变量名**必须**指定。"
+"闭包的语法和功能使其非常适合即时使用。调用闭包与调用函数完全相同。不过,闭包"
+"的输入和返回类型**可以**被推断,而输入变量名**必须**指定。"
#: src/fn/closures.md:15
msgid "Other characteristics of closures include:"
msgstr "闭包的其他特点包括:"
-#: src/fn/closures.md:16
+#: src/fn/closures.md:17
msgid "using `||` instead of `()` around input variables."
msgstr "使用 `||` 而不是 `()` 来包围输入变量。"
-#: src/fn/closures.md:17
+#: src/fn/closures.md:18
msgid ""
"optional body delimitation (`{}`) for a single line expression (mandatory "
"otherwise)."
msgstr "单行表达式可省略函数体定界符(`{}`),其他情况则必须使用"
-#: src/fn/closures.md:18
+#: src/fn/closures.md:19
msgid "the ability to capture the outer environment variables."
msgstr "能够捕获外部环境的变量"
-#: src/fn/closures.md:24
+#: src/fn/closures.md:25
msgid ""
"// A regular function can't refer to variables in the enclosing environment\n"
" //fn function(i: i32) -> i32 { i + outer_var }\n"
@@ -5363,7 +5521,7 @@
" // TODO:取消上面这行的注释,查看编译器错误\n"
" // 编译器会建议我们定义一个闭包来替代\n"
-#: src/fn/closures.md:29
+#: src/fn/closures.md:30
msgid ""
"// Closures are anonymous, here we are binding them to references.\n"
" // Annotation is identical to function annotation but is optional\n"
@@ -5375,19 +5533,19 @@
" // 包裹函数体的 `{}` 也是可选的\n"
" // 这些无名函数被赋值给适当命名的变量\n"
-#: src/fn/closures.md:36
+#: src/fn/closures.md:37
msgid "// Call the closures.\n"
msgstr "// 调用闭包\n"
-#: src/fn/closures.md:37
+#: src/fn/closures.md:38
msgid "\"closure_annotated: {}\""
msgstr "\"closure_annotated:{}\""
-#: src/fn/closures.md:38
+#: src/fn/closures.md:39
msgid "\"closure_inferred: {}\""
msgstr "\"closure_inferred:{}\""
-#: src/fn/closures.md:39
+#: src/fn/closures.md:40
msgid ""
"// Once closure's type has been inferred, it cannot be inferred again with "
"another type.\n"
@@ -5400,7 +5558,7 @@
"closure_inferred(42i64));\n"
" // TODO:取消上面这行的注释,观察编译器错误。\n"
-#: src/fn/closures.md:43
+#: src/fn/closures.md:44
msgid ""
"// A closure taking no arguments which returns an `i32`.\n"
" // The return type is inferred.\n"
@@ -5408,7 +5566,7 @@
"// 一个无参数并返回 `i32` 的闭包。\n"
" // 返回类型是推断的。\n"
-#: src/fn/closures.md:46
+#: src/fn/closures.md:47
msgid "\"closure returning one: {}\""
msgstr "\"返回 1 的闭包:{}\""
@@ -5419,7 +5577,8 @@
"flexibly adapt to the use case, sometimes moving and sometimes borrowing. "
"Closures can capture variables:"
msgstr ""
-"闭包本质上很灵活,无需注解就能根据功能需求自动适应。这使得捕获可以灵活地适应不同场景,有时移动,有时借用。闭包可以通过以下方式捕获变量:"
+"闭包本质上很灵活,无需注解就能根据功能需求自动适应。这使得捕获可以灵活地适应"
+"不同场景,有时移动,有时借用。闭包可以通过以下方式捕获变量:"
#: src/fn/closures/capture.md:8
msgid "by reference: `&T`"
@@ -5446,7 +5605,8 @@
#: src/fn/closures/capture.md:21
msgid ""
"// A closure to print `color` which immediately borrows (`&`) `color` and\n"
-" // stores the borrow and closure in the `print` variable. It will remain\n"
+" // stores the borrow and closure in the `print` variable. It will "
+"remain\n"
" // borrowed until `print` is used the last time. \n"
" //\n"
" // `println!` only requires arguments by immutable reference so it "
@@ -5486,7 +5646,8 @@
" // but `&mut count` is less restrictive so it takes that. Immediately\n"
" // borrows `count`.\n"
" //\n"
-" // A `mut` is required on `inc` because a `&mut` is stored inside. Thus,\n"
+" // A `mut` is required on `inc` because a `&mut` is stored inside. "
+"Thus,\n"
" // calling the closure mutates `count` which requires a `mut`.\n"
msgstr ""
"// 增加 `count` 的闭包可以接受 `&mut count` 或 `count`,\n"
@@ -5592,21 +5753,21 @@
"[`Box`](../../std/box.md) and [`std::mem::drop`](https://doc.rust-lang.org/"
"std/mem/fn.drop.html)"
msgstr ""
-"[`Box`](../../std/box.md) 和 [`std::mem::drop`]"
-"(https://doc.rust-lang.org/std/mem/fn.drop.html)"
+"[`Box`](../../std/box.md) 和 [`std::mem::drop`](https://doc.rust-lang.org/"
+"std/mem/fn.drop.html)"
#: src/fn/closures/input_parameters.md:3
msgid ""
"While Rust chooses how to capture variables on the fly mostly without type "
-"annotation, this ambiguity is not allowed when writing functions. When taking "
-"a closure as an input parameter, the closure's complete type must be "
+"annotation, this ambiguity is not allowed when writing functions. When "
+"taking a closure as an input parameter, the closure's complete type must be "
"annotated using one of a few `traits`, and they're determined by what the "
"closure does with captured value. In order of decreasing restriction, they "
"are:"
msgstr ""
-"Rust 通常能自动选择如何捕获变量,无需类型标注。但在编写函数时,这种模糊性是不允许的。"
-"当将闭包作为输入参数时,必须使用特定的 `trait` 来注解闭包的完整类型。这些 trait "
-"由闭包对捕获值的处理方式决定。按限制程度从高到低排列如下:"
+"Rust 通常能自动选择如何捕获变量,无需类型标注。但在编写函数时,这种模糊性是不"
+"允许的。当将闭包作为输入参数时,必须使用特定的 `trait` 来注解闭包的完整类型。"
+"这些 trait 由闭包对捕获值的处理方式决定。按限制程度从高到低排列如下:"
#: src/fn/closures/input_parameters.md:10
msgid "`Fn`: the closure uses the captured value by reference (`&T`)"
@@ -5629,28 +5790,31 @@
#: src/fn/closures/input_parameters.md:17
msgid ""
-"For instance, consider a parameter annotated as `FnOnce`. This specifies that "
-"the closure _may_ capture by `&T`, `&mut T`, or `T`, but the compiler will "
-"ultimately choose based on how the captured variables are used in the closure."
+"For instance, consider a parameter annotated as `FnOnce`. This specifies "
+"that the closure _may_ capture by `&T`, `&mut T`, or `T`, but the compiler "
+"will ultimately choose based on how the captured variables are used in the "
+"closure."
msgstr ""
-"例如,考虑一个注解为 `FnOnce` 的参数。这表示闭包**可能**通过 `&T`、`&mut T` 或 `T` "
-"进行捕获,但编译器最终会根据捕获变量在闭包中的使用方式来决定。"
+"例如,考虑一个注解为 `FnOnce` 的参数。这表示闭包**可能**通过 `&T`、`&mut T` "
+"或 `T` 进行捕获,但编译器最终会根据捕获变量在闭包中的使用方式来决定。"
#: src/fn/closures/input_parameters.md:22
msgid ""
-"This is because if a move is possible, then any type of borrow should also be "
-"possible. Note that the reverse is not true. If the parameter is annotated as "
-"`Fn`, then capturing variables by `&mut T` or `T` are not allowed. However, "
-"`&T` is allowed."
+"This is because if a move is possible, then any type of borrow should also "
+"be possible. Note that the reverse is not true. If the parameter is "
+"annotated as `Fn`, then capturing variables by `&mut T` or `T` are not "
+"allowed. However, `&T` is allowed."
msgstr ""
"这是因为如果可以移动,那么任何类型的借用也应该是可能的。注意反过来并不成立。"
-"如果参数被注解为 `Fn`,那么通过 `&mut T` 或 `T` 捕获变量是不允许的。但 `&T` 是允许的。"
+"如果参数被注解为 `Fn`,那么通过 `&mut T` 或 `T` 捕获变量是不允许的。但 `&T` "
+"是允许的。"
#: src/fn/closures/input_parameters.md:27
msgid ""
"In the following example, try swapping the usage of `Fn`, `FnMut`, and "
"`FnOnce` to see what happens:"
-msgstr "在下面的例子中,尝试交换 `Fn`、`FnMut` 和 `FnOnce` 的用法,看看会发生什么:"
+msgstr ""
+"在下面的例子中,尝试交换 `Fn`、`FnMut` 和 `FnOnce` 的用法,看看会发生什么:"
#: src/fn/closures/input_parameters.md:31
msgid ""
@@ -5658,7 +5822,7 @@
"// <F> denotes that F is a \"Generic type parameter\"\n"
msgstr ""
"// 这个函数接受一个闭包作为参数并调用它\n"
-"// <F> 表示 F 是一个"泛型类型参数"\n"
+"// <F> 表示 F 是一个\"泛型类型参数\"\n"
#: src/fn/closures/input_parameters.md:34
msgid "// The closure takes no input and returns nothing.\n"
@@ -5747,16 +5911,16 @@
#: src/fn/closures/input_parameters.md:86
msgid ""
"[`std::mem::drop`](https://doc.rust-lang.org/std/mem/fn.drop.html), [`Fn`]"
-"(https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://doc.rust-"
-"lang.org/std/ops/trait.FnMut.html), [Generics](../../generics.md), [where]"
-"(../../generics/where.md) and [`FnOnce`](https://doc.rust-lang.org/std/ops/"
-"trait.FnOnce.html)"
+"(https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://"
+"doc.rust-lang.org/std/ops/trait.FnMut.html), [Generics](../../generics.md), "
+"[where](../../generics/where.md) and [`FnOnce`](https://doc.rust-lang.org/"
+"std/ops/trait.FnOnce.html)"
msgstr ""
"[`std::mem::drop`](https://doc.rust-lang.org/std/mem/fn.drop.html)、[`Fn`]"
-"(https://doc.rust-lang.org/std/ops/trait.Fn.html)、[`FnMut`](https://doc.rust-"
-"lang.org/std/ops/trait.FnMut.html)、[泛型](../../generics.md)、[where]"
-"(../../generics/where.md) 和 [`FnOnce`](https://doc.rust-lang.org/std/ops/"
-"trait.FnOnce.html)"
+"(https://doc.rust-lang.org/std/ops/trait.Fn.html)、[`FnMut`](https://"
+"doc.rust-lang.org/std/ops/trait.FnMut.html)、[泛型](../../generics.md)、"
+"[where](../../generics/where.md) 和 [`FnOnce`](https://doc.rust-lang.org/std/"
+"ops/trait.FnOnce.html)"
#: src/fn/closures/anonymity.md:3
msgid ""
@@ -5765,7 +5929,9 @@
"parameter requires [generics](../../generics.md), which is necessary because "
"of how they are defined:"
msgstr ""
-"闭包能简洁地从外部作用域捕获变量。这会有什么影响吗?当然会有。注意观察如何将闭包作为函数参数使用时需要[泛型](../../generics.md),这是由于闭包的定义方式所决定的:"
+"闭包能简洁地从外部作用域捕获变量。这会有什么影响吗?当然会有。注意观察如何将"
+"闭包作为函数参数使用时需要[泛型](../../generics.md),这是由于闭包的定义方式所"
+"决定的:"
#: src/fn/closures/anonymity.md:9
msgid "// `F` must be generic.\n"
@@ -5779,16 +5945,20 @@
"unknown type. This type is assigned to the variable which is stored until "
"calling."
msgstr ""
-"当定义一个闭包时,编译器会隐式创建一个新的匿名结构来存储内部捕获的变量,同时通过 `Fn`、`FnMut` 或 `FnOnce` 这些 `trait` 之一为这个未知类型实现功能。这个类型被赋给变量并存储,直到被调用。"
+"当定义一个闭包时,编译器会隐式创建一个新的匿名结构来存储内部捕获的变量,同时"
+"通过 `Fn`、`FnMut` 或 `FnOnce` 这些 `trait` 之一为这个未知类型实现功能。这个"
+"类型被赋给变量并存储,直到被调用。"
#: src/fn/closures/anonymity.md:22
msgid ""
"Since this new type is of unknown type, any usage in a function will require "
-"generics. However, an unbounded type parameter `<T>` would still be ambiguous "
-"and not be allowed. Thus, bounding by one of the `traits`: `Fn`, `FnMut`, or "
-"`FnOnce` (which it implements) is sufficient to specify its type."
+"generics. However, an unbounded type parameter `<T>` would still be "
+"ambiguous and not be allowed. Thus, bounding by one of the `traits`: `Fn`, "
+"`FnMut`, or `FnOnce` (which it implements) is sufficient to specify its type."
msgstr ""
-"由于这个新类型是未知类型,在函数中使用时就需要泛型。然而,一个无界的类型参数 `<T>` 仍然会是模糊的,不被允许。因此,通过 `Fn`、`FnMut` 或 `FnOnce` 这些 `trait` 之一(它实现的)来约束就足以指定其类型。"
+"由于这个新类型是未知类型,在函数中使用时就需要泛型。然而,一个无界的类型参数 "
+"`<T>` 仍然会是模糊的,不被允许。因此,通过 `Fn`、`FnMut` 或 `FnOnce` 这些 "
+"`trait` 之一(它实现的)来约束就足以指定其类型。"
#: src/fn/closures/anonymity.md:28
msgid ""
@@ -5809,15 +5979,15 @@
#: src/fn/closures/anonymity.md:49
msgid ""
-"[A thorough analysis](https://huonw.github.io/blog/2015/05/finding-closure-in-"
-"rust/), [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`]"
+"[A thorough analysis](https://huonw.github.io/blog/2015/05/finding-closure-"
+"in-rust/), [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`]"
"(https://doc.rust-lang.org/std/ops/trait.FnMut.html), and [`FnOnce`](https://"
"doc.rust-lang.org/std/ops/trait.FnOnce.html)"
msgstr ""
"[深入分析](https://huonw.github.io/blog/2015/05/finding-closure-in-rust/)、"
-"[`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html)、[`FnMut`]"
-"(https://doc.rust-lang.org/std/ops/trait.FnMut.html) 和 [`FnOnce`](https://"
-"doc.rust-lang.org/std/ops/trait.FnOnce.html)"
+"[`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html)、[`FnMut`](https://"
+"doc.rust-lang.org/std/ops/trait.FnMut.html) 和 [`FnOnce`](https://doc.rust-"
+"lang.org/std/ops/trait.FnOnce.html)"
#: src/fn/closures/input_functions.md:3
msgid ""
@@ -5826,14 +5996,15 @@
"takes a closure as parameter, then any function that satisfies the trait "
"bound of that closure can be passed as a parameter."
msgstr ""
-"既然闭包可以作为参数使用,你可能会想知道函数是否也可以这样。确实可以!如果你声明一个函数,它接受一个闭包作为参数,那么任何满足该闭包 trait 约束的函数都可以作为参数传递。"
+"既然闭包可以作为参数使用,你可能会想知道函数是否也可以这样。确实可以!如果你"
+"声明一个函数,它接受一个闭包作为参数,那么任何满足该闭包 trait 约束的函数都可"
+"以作为参数传递。"
#: src/fn/closures/input_functions.md:9
msgid ""
"// Define a function which takes a generic `F` argument\n"
"// bounded by `Fn`, and calls it\n"
-msgstr ""
-"// 定义一个函数,它接受一个由 `Fn` 约束的泛型参数 `F`,并调用它\n"
+msgstr "// 定义一个函数,它接受一个由 `Fn` 约束的泛型参数 `F`,并调用它\n"
#: src/fn/closures/input_functions.md:14
msgid "// Define a wrapper function satisfying the `Fn` bound\n"
@@ -5853,10 +6024,11 @@
#: src/fn/closures/input_functions.md:29
msgid ""
-"As an additional note, the `Fn`, `FnMut`, and `FnOnce` `traits` dictate how a "
-"closure captures variables from the enclosing scope."
+"As an additional note, the `Fn`, `FnMut`, and `FnOnce` `traits` dictate how "
+"a closure captures variables from the enclosing scope."
msgstr ""
-"另外需要注意的是,`Fn`、`FnMut` 和 `FnOnce` 这些 trait 决定了闭包如何从外部作用域捕获变量。"
+"另外需要注意的是,`Fn`、`FnMut` 和 `FnOnce` 这些 trait 决定了闭包如何从外部作"
+"用域捕获变量。"
#: src/fn/closures/input_functions.md:34
msgid ""
@@ -5876,7 +6048,8 @@
"parameters should also be possible. However, anonymous closure types are, by "
"definition, unknown, so we have to use `impl Trait` to return them."
msgstr ""
-"既然闭包可以作为输入参数,那么将闭包作为输出参数返回也应该是可行的。然而,匿名闭包类型本质上是未知的,因此我们必须使用 `impl Trait` 来返回它们。"
+"既然闭包可以作为输入参数,那么将闭包作为输出参数返回也应该是可行的。然而,匿"
+"名闭包类型本质上是未知的,因此我们必须使用 `impl Trait` 来返回它们。"
#: src/fn/closures/output_parameters.md:8
msgid "The valid traits for returning a closure are:"
@@ -5896,12 +6069,13 @@
#: src/fn/closures/output_parameters.md:14
msgid ""
-"Beyond this, the `move` keyword must be used, which signals that all captures "
-"occur by value. This is required because any captures by reference would be "
-"dropped as soon as the function exited, leaving invalid references in the "
-"closure."
+"Beyond this, the `move` keyword must be used, which signals that all "
+"captures occur by value. This is required because any captures by reference "
+"would be dropped as soon as the function exited, leaving invalid references "
+"in the closure."
msgstr ""
-"此外,必须使用 `move` 关键字,它表示所有捕获都是按值进行的。这是必要的,因为任何通过引用捕获的变量都会在函数退出时被丢弃,从而在闭包中留下无效的引用。"
+"此外,必须使用 `move` 关键字,它表示所有捕获都是按值进行的。这是必要的,因为"
+"任何通过引用捕获的变量都会在函数退出时被丢弃,从而在闭包中留下无效的引用。"
#: src/fn/closures/output_parameters.md:21
msgid "\"Fn\""
@@ -5936,7 +6110,8 @@
#: src/fn/closures/closure_examples.md:3
msgid ""
-"This section contains a few examples of using closures from the `std` library."
+"This section contains a few examples of using closures from the `std` "
+"library."
msgstr "本节包含一些使用 `std` 库中闭包的示例。"
#: src/fn/closures/closure_examples/iter_any.md:3
@@ -5945,7 +6120,8 @@
"`true` if any element satisfies the predicate. Otherwise `false`. Its "
"signature:"
msgstr ""
-"`Iterator::any` 是一个函数,它接受一个迭代器作为参数。如果任何元素满足给定的条件,则返回 `true`,否则返回 `false`。其签名如下:"
+"`Iterator::any` 是一个函数,它接受一个迭代器作为参数。如果任何元素满足给定的"
+"条件,则返回 `true`,否则返回 `false`。其签名如下:"
#: src/fn/closures/closure_examples/iter_any.md:9
#: src/fn/closures/closure_examples/iter_find.md:9
@@ -6029,12 +6205,13 @@
#: src/fn/closures/closure_examples/iter_any.md:52
msgid ""
-"[`std::iter::Iterator::any`](https://doc.rust-lang.org/std/iter/trait."
-"Iterator.html#method.any)"
+"[`std::iter::Iterator::any`](https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.any)"
msgstr ""
"[`std::iter::Iterator::any`]\n"
"\n"
-"[`std::iter::Iterator::any`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.any"
+"[`std::iter::Iterator::any`]: https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.any"
#: src/fn/closures/closure_examples/iter_find.md:3
msgid ""
@@ -6042,7 +6219,8 @@
"for the first value which satisfies some condition. If none of the values "
"satisfy the condition, it returns `None`. Its signature:"
msgstr ""
-"`Iterator::find` 是一个函数,它遍历迭代器并搜索满足特定条件的第一个值。如果没有值满足条件,则返回 `None`。其签名如下:"
+"`Iterator::find` 是一个函数,它遍历迭代器并搜索满足特定条件的第一个值。如果没"
+"有值满足条件,则返回 `None`。其签名如下:"
#: src/fn/closures/closure_examples/iter_find.md:12
msgid ""
@@ -6114,7 +6292,8 @@
"`Iterator::find` gives you a reference to the item. But if you want the "
"_index_ of the item, use `Iterator::position`."
msgstr ""
-"`Iterator::find` 返回元素的引用。如果需获取元素的**索引**,则使用 `Iterator::position`。"
+"`Iterator::find` 返回元素的引用。如果需获取元素的**索引**,则使用 "
+"`Iterator::position`。"
#: src/fn/closures/closure_examples/iter_find.md:56
msgid ""
@@ -6136,47 +6315,53 @@
#: src/fn/closures/closure_examples/iter_find.md:70
msgid ""
-"[`std::iter::Iterator::find`](https://doc.rust-lang.org/std/iter/trait."
-"Iterator.html#method.find)"
+"[`std::iter::Iterator::find`](https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.find)"
msgstr ""
"[`std::iter::Iterator::find`]\n"
"\n"
-"[`std::iter::Iterator::find`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.find"
+"[`std::iter::Iterator::find`]: https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.find"
#: src/fn/closures/closure_examples/iter_find.md:72
msgid ""
-"[`std::iter::Iterator::find_map`](https://doc.rust-lang.org/std/iter/trait."
-"Iterator.html#method.find_map)"
+"[`std::iter::Iterator::find_map`](https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.find_map)"
msgstr ""
"[`std::iter::Iterator::find_map`]\n"
"\n"
-"[`std::iter::Iterator::find_map`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.find_map"
+"[`std::iter::Iterator::find_map`]: https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.find_map"
#: src/fn/closures/closure_examples/iter_find.md:74
msgid ""
-"[`std::iter::Iterator::position`](https://doc.rust-lang.org/std/iter/trait."
-"Iterator.html#method.position)"
+"[`std::iter::Iterator::position`](https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.position)"
msgstr ""
"[`std::iter::Iterator::position`]\n"
"\n"
-"[`std::iter::Iterator::position`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.position"
+"[`std::iter::Iterator::position`]: https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.position"
#: src/fn/closures/closure_examples/iter_find.md:76
msgid ""
-"[`std::iter::Iterator::rposition`](https://doc.rust-lang.org/std/iter/trait."
-"Iterator.html#method.rposition)"
+"[`std::iter::Iterator::rposition`](https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.rposition)"
msgstr ""
"[`std::iter::Iterator::rposition`]\n"
"\n"
-"[`std::iter::Iterator::rposition`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.rposition"
+"[`std::iter::Iterator::rposition`]: https://doc.rust-lang.org/std/iter/"
+"trait.Iterator.html#method.rposition"
#: src/fn/hof.md:3
msgid ""
-"Rust provides Higher Order Functions (HOF). These are functions that take one "
-"or more functions and/or produce a more useful function. HOFs and lazy "
+"Rust provides Higher Order Functions (HOF). These are functions that take "
+"one or more functions and/or produce a more useful function. HOFs and lazy "
"iterators give Rust its functional flavor."
msgstr ""
-"Rust 提供了高阶函数(Higher Order Functions,HOF)。这些函数接受一个或多个函数作为参数,并/或产生一个更有用的函数。HOF 和惰性迭代器赋予了 Rust 函数式编程的特性。"
+"Rust 提供了高阶函数(Higher Order Functions,HOF)。这些函数接受一个或多个函"
+"数作为参数,并/或产生一个更有用的函数。HOF 和惰性迭代器赋予了 Rust 函数式编程"
+"的特性。"
#: src/fn/hof.md:13
msgid "\"Find the sum of all the numbers with odd squares under 1000\""
@@ -6237,8 +6422,8 @@
#: src/fn/hof.md:44
msgid ""
"[Option](https://doc.rust-lang.org/core/option/enum.Option.html) and "
-"[Iterator](https://doc.rust-lang.org/core/iter/trait.Iterator.html) implement "
-"their fair share of HOFs."
+"[Iterator](https://doc.rust-lang.org/core/iter/trait.Iterator.html) "
+"implement their fair share of HOFs."
msgstr ""
"[Option] 和 [Iterator] 实现了相当多的高阶函数。\n"
"\n"
@@ -6249,8 +6434,7 @@
msgid ""
"Diverging functions never return. They are marked using `!`, which is an "
"empty type."
-msgstr ""
-"发散函数永不返回。它们使用 `!` 标记,这是一个空类型。"
+msgstr "发散函数永不返回。它们使用 `!` 标记,这是一个空类型。"
#: src/fn/diverging.md:7 src/fn/diverging.md:35
msgid "\"This call never returns.\""
@@ -6262,14 +6446,14 @@
"the set of all possible values this type can have is empty. Note that, it is "
"different from the `()` type, which has exactly one possible value."
msgstr ""
-"与所有其他类型相反,这个类型不能被实例化,因为这个类型可能拥有的所有可能值的集合是空的。注意,它与 `()` 类型不同,后者恰好有一个可能的值。"
+"与所有其他类型相反,这个类型不能被实例化,因为这个类型可能拥有的所有可能值的"
+"集合是空的。注意,它与 `()` 类型不同,后者恰好有一个可能的值。"
#: src/fn/diverging.md:15
msgid ""
-"For example, this function returns as usual, although there is no information "
-"in the return value."
-msgstr ""
-"例如,这个函数像往常一样返回,尽管返回值中没有任何信息。"
+"For example, this function returns as usual, although there is no "
+"information in the return value."
+msgstr "例如,这个函数像往常一样返回,尽管返回值中没有任何信息。"
#: src/fn/diverging.md:25
msgid "\"This function returns and you can see this line.\""
@@ -6279,8 +6463,7 @@
msgid ""
"As opposed to this function, which will never return the control back to the "
"caller."
-msgstr ""
-"与之相对的是这个函数,它永远不会将控制权返回给调用者。"
+msgstr "与之相对的是这个函数,它永远不会将控制权返回给调用者。"
#: src/fn/diverging.md:36
msgid "\"You will never see this line!\""
@@ -6288,13 +6471,15 @@
#: src/fn/diverging.md:40
msgid ""
-"Although this might seem like an abstract concept, it is actually very useful "
-"and often handy. The main advantage of this type is that it can be cast to "
-"any other type, making it versatile in situations where an exact type is "
-"required, such as in match branches. This flexibility allows us to write code "
-"like this:"
+"Although this might seem like an abstract concept, it is actually very "
+"useful and often handy. The main advantage of this type is that it can be "
+"cast to any other type, making it versatile in situations where an exact "
+"type is required, such as in match branches. This flexibility allows us to "
+"write code like this:"
msgstr ""
-"虽然这看起来像是一个抽象概念,但它实际上非常有用且经常派上用场。这种类型的主要优势是它可以被转换为任何其他类型,这使得它在需要精确类型的情况下非常灵活,比如在 match 分支中。这种灵活性允许我们编写如下代码:"
+"虽然这看起来像是一个抽象概念,但它实际上非常有用且经常派上用场。这种类型的主"
+"要优势是它可以被转换为任何其他类型,这使得它在需要精确类型的情况下非常灵活,"
+"比如在 match 分支中。这种灵活性允许我们编写如下代码:"
#: src/fn/diverging.md:50
msgid ""
@@ -6329,20 +6514,22 @@
"It is also the return type of functions that loop forever (e.g. `loop {}`) "
"like network servers or functions that terminate the process (e.g. `exit()`)."
msgstr ""
-"它也是永远循环的函数(例如 `loop {}`)的返回类型,比如网络服务器,或终止进程的函数(例如 `exit()`)。"
+"它也是永远循环的函数(例如 `loop {}`)的返回类型,比如网络服务器,或终止进程"
+"的函数(例如 `exit()`)。"
#: src/mod.md:3
msgid ""
"Rust provides a powerful module system that can be used to hierarchically "
-"split code in logical units (modules), and manage visibility (public/private) "
-"between them."
+"split code in logical units (modules), and manage visibility (public/"
+"private) between them."
msgstr ""
-"Rust 提供了一个强大的模块系统,可以用来将代码分层地拆分成逻辑单元(模块),并管理它们之间的可见性(公有/私有)。"
+"Rust 提供了一个强大的模块系统,可以用来将代码分层地拆分成逻辑单元(模块),并"
+"管理它们之间的可见性(公有/私有)。"
#: src/mod.md:7
msgid ""
-"A module is a collection of items: functions, structs, traits, `impl` blocks, "
-"and even other modules."
+"A module is a collection of items: functions, structs, traits, `impl` "
+"blocks, and even other modules."
msgstr ""
"一个模块是一系列项的集合:函数、结构体、trait、`impl` 块,甚至其他模块。"
@@ -6352,7 +6539,8 @@
"overridden with the `pub` modifier. Only the public items of a module can be "
"accessed from outside the module scope."
msgstr ""
-"默认情况下,模块中的项具有私有可见性,但可以使用 `pub` 修饰符来覆盖这一默认行为。只有模块中的公有项可以从模块作用域外部访问。"
+"默认情况下,模块中的项具有私有可见性,但可以使用 `pub` 修饰符来覆盖这一默认行"
+"为。只有模块中的公有项可以从模块作用域外部访问。"
#: src/mod/visibility.md:8
msgid "// A module named `my_mod`\n"
@@ -6401,7 +6589,8 @@
#: src/mod/visibility.md:38
msgid ""
"// Functions declared using `pub(in path)` syntax are only visible\n"
-" // within the given path. `path` must be a parent or ancestor module\n"
+" // within the given path. `path` must be a parent or ancestor "
+"module\n"
msgstr ""
"// 使用 `pub(in path)` 语法声明的函数只在给定的路径中可见。\n"
" // `path` 必须是父模块或祖先模块\n"
@@ -6476,15 +6665,15 @@
msgstr "\"调用了 `function()`\""
#: src/mod/visibility.md:91
-msgid "// Modules allow disambiguation between items that have the same name.\n"
+msgid ""
+"// Modules allow disambiguation between items that have the same name.\n"
msgstr "// 模块允许消除同名项之间的歧义。\n"
#: src/mod/visibility.md:95
msgid ""
"// Public items, including those inside nested modules, can be\n"
" // accessed from outside the parent module.\n"
-msgstr ""
-"// 公有项(包括嵌套模块内的)可以从父模块外部访问。\n"
+msgstr "// 公有项(包括嵌套模块内的)可以从父模块外部访问。\n"
#: src/mod/visibility.md:101
msgid "// pub(crate) items can be called from anywhere in the same crate\n"
@@ -6506,8 +6695,7 @@
msgid ""
"// Private items of a module cannot be directly accessed, even if\n"
" // nested in a public module:\n"
-msgstr ""
-"// 模块的私有项不能被直接访问,即使它们嵌套在公有模块中:\n"
+msgstr "// 模块的私有项不能被直接访问,即使它们嵌套在公有模块中:\n"
#: src/mod/visibility.md:112
msgid ""
@@ -6556,8 +6744,9 @@
"visibility only matters when a struct is accessed from outside the module "
"where it is defined, and has the goal of hiding information (encapsulation)."
msgstr ""
-"结构体的字段具有额外的可见性级别。字段默认为私有,可以使用 `pub` 修饰符来覆盖。"
-"这种可见性只在从结构体定义模块外部访问时才有意义,其目的是实现信息隐藏(封装)。"
+"结构体的字段具有额外的可见性级别。字段默认为私有,可以使用 `pub` 修饰符来覆"
+"盖。这种可见性只在从结构体定义模块外部访问时才有意义,其目的是实现信息隐藏"
+"(封装)。"
#: src/mod/struct_visibility.md:10
msgid "// A public struct with a public field of generic type `T`\n"
@@ -6605,8 +6794,7 @@
msgid ""
"// However, structs with private fields can be created using\n"
" // public constructors\n"
-msgstr ""
-"// 然而,具有私有字段的结构体可以使用公有构造函数创建\n"
+msgstr "// 然而,具有私有字段的结构体可以使用公有构造函数创建\n"
#: src/mod/struct_visibility.md:44
msgid "\"classified information\""
@@ -6680,7 +6868,8 @@
"The `super` and `self` keywords can be used in the path to remove ambiguity "
"when accessing items and to prevent unnecessary hardcoding of paths."
msgstr ""
-"`super` 和 `self` 关键字可以在路径中使用,以消除访问项目时的歧义,并避免不必要的路径硬编码。"
+"`super` 和 `self` 关键字可以在路径中使用,以消除访问项目时的歧义,并避免不必"
+"要的路径硬编码。"
#: src/mod/super.md:13
msgid "\"called `cool::function()`\""
@@ -6704,7 +6893,8 @@
#: src/mod/super.md:32
msgid ""
-"// The `self` keyword refers to the current module scope - in this case `my`.\n"
+"// The `self` keyword refers to the current module scope - in this case "
+"`my`.\n"
" // Calling `self::function()` and calling `function()` directly both "
"give\n"
" // the same result, because they refer to the same function.\n"
@@ -6719,7 +6909,8 @@
#: src/mod/super.md:41
msgid ""
-"// The `super` keyword refers to the parent scope (outside the `my` module).\n"
+"// The `super` keyword refers to the parent scope (outside the `my` "
+"module).\n"
msgstr "// `super` 关键字指的是父作用域(`my` 模块之外)。\n"
#: src/mod/super.md:44
@@ -6735,7 +6926,8 @@
"Modules can be mapped to a file/directory hierarchy. Let's break down the "
"[visibility example](visibility.md) in files:"
msgstr ""
-"模块可以映射到文件/目录层次结构。让我们将[可见性示例](visibility.md)拆分成多个文件:"
+"模块可以映射到文件/目录层次结构。让我们将[可见性示例](visibility.md)拆分成多"
+"个文件:"
#: src/mod/split.md:16
msgid "In `split.rs`:"
@@ -6755,7 +6947,8 @@
#: src/mod/split.md:42
msgid ""
-"// Similarly `mod inaccessible` and `mod nested` will locate the `nested.rs`\n"
+"// Similarly `mod inaccessible` and `mod nested` will locate the "
+"`nested.rs`\n"
"// and `inaccessible.rs` files and insert them here under their respective\n"
"// modules\n"
msgstr ""
@@ -6804,7 +6997,10 @@
"_before_ running the compiler over it. In other words, modules do _not_ get "
"compiled individually, only crates get compiled."
msgstr ""
-"在 Rust 中,crate 是一个编译单元。每当执行 `rustc some_file.rs` 时,`some_file.rs` 就被视为**crate 文件**。如果 `some_file.rs` 中包含 `mod` 声明,那么模块文件的内容会在编译器处理之前被插入到 crate 文件中 `mod` 声明的位置。换句话说,模块**不会**被单独编译,只有 crate 才会被编译。"
+"在 Rust 中,crate 是一个编译单元。每当执行 `rustc some_file.rs` 时,"
+"`some_file.rs` 就被视为**crate 文件**。如果 `some_file.rs` 中包含 `mod` 声"
+"明,那么模块文件的内容会在编译器处理之前被插入到 crate 文件中 `mod` 声明的位"
+"置。换句话说,模块**不会**被单独编译,只有 crate 才会被编译。"
#: src/crates.md:10
msgid ""
@@ -6812,7 +7008,9 @@
"will produce a binary from a crate. This behavior can be overridden by "
"passing the `--crate-type` flag to `lib`."
msgstr ""
-"一个 crate 可以被编译成二进制文件或库。默认情况下,`rustc` 会将 crate 编译成二进制文件。通过向 `rustc` 传递 `--crate-type` 标志并指定 `lib`,可以改变这一默认行为。"
+"一个 crate 可以被编译成二进制文件或库。默认情况下,`rustc` 会将 crate 编译成"
+"二进制文件。通过向 `rustc` 传递 `--crate-type` 标志并指定 `lib`,可以改变这一"
+"默认行为。"
#: src/crates/lib.md:3
msgid "Let's create a library, and then see how to link it to another crate."
@@ -6841,7 +7039,9 @@
"crate-name` option to `rustc` or by using the [`crate_name` attribute](../"
"attribute/crate.md)."
msgstr ""
-"库文件名会自动添加 \"lib\" 前缀,默认使用 crate 文件的名称。但可以通过向 `rustc` 传递 `--crate-name` 选项或使用 [`crate_name` 属性](../attribute/crate.md) 来覆盖这个默认名称。"
+"库文件名会自动添加 \"lib\" 前缀,默认使用 crate 文件的名称。但可以通过向 "
+"`rustc` 传递 `--crate-name` 选项或使用 [`crate_name` 属性](../attribute/"
+"crate.md) 来覆盖这个默认名称。"
#: src/crates/using_lib.md:3
msgid ""
@@ -6849,13 +7049,13 @@
"All of its items will then be imported under a module named the same as the "
"library. This module generally behaves the same way as any other module."
msgstr ""
-"要将 crate 链接到这个新库,可以使用 `rustc` 的 `--extern` 标志。库中的所有项目都会被导入到一个与库同名的模块下。这个模块的行为通常与其他模块相同。"
+"要将 crate 链接到这个新库,可以使用 `rustc` 的 `--extern` 标志。库中的所有项"
+"目都会被导入到一个与库同名的模块下。这个模块的行为通常与其他模块相同。"
#: src/crates/using_lib.md:8
msgid ""
"// extern crate rary; // May be required for Rust 2015 edition or earlier\n"
-msgstr ""
-"// extern crate rary; // Rust 2015 版本或更早版本可能需要此声明\n"
+msgstr "// extern crate rary; // Rust 2015 版本或更早版本可能需要此声明\n"
#: src/crates/using_lib.md:13
msgid ""
@@ -6870,7 +7070,8 @@
"`cargo` is the official Rust package management tool. It has lots of really "
"useful features to improve code quality and developer velocity! These include"
msgstr ""
-"`cargo` 是 Rust 的官方包管理工具。它提供了许多非常有用的功能,可以提高代码质量和开发效率!这些功能包括:"
+"`cargo` 是 Rust 的官方包管理工具。它提供了许多非常有用的功能,可以提高代码质"
+"量和开发效率!这些功能包括:"
#: src/cargo.md:6
msgid ""
@@ -6892,7 +7093,8 @@
"This chapter will go through some quick basics, but you can find the "
"comprehensive docs in [The Cargo Book](https://doc.rust-lang.org/cargo/)."
msgstr ""
-"本章将快速介绍一些基础知识,更全面的文档可以在 [Cargo 手册](https://doc.rust-lang.org/cargo/) 中找到。"
+"本章将快速介绍一些基础知识,更全面的文档可以在 [Cargo 手册](https://doc.rust-"
+"lang.org/cargo/) 中找到。"
#: src/cargo/deps.md:3
msgid ""
@@ -6901,7 +7103,8 @@
"Rust ecosystem comes standard with `cargo`! `cargo` can manage dependencies "
"for a project."
msgstr ""
-"大多数程序都依赖于一些库。如果你曾经手动管理过依赖,你就知道这有多么痛苦。幸运的是,Rust 生态系统标配了 `cargo`!`cargo` 可以为项目管理依赖。"
+"大多数程序都依赖于一些库。如果你曾经手动管理过依赖,你就知道这有多么痛苦。幸"
+"运的是,Rust 生态系统标配了 `cargo`!`cargo` 可以为项目管理依赖。"
#: src/cargo/deps.md:8
msgid "To create a new Rust project,"
@@ -6920,7 +7123,8 @@
"For the rest of this chapter, let's assume we are making a binary, rather "
"than a library, but all of the concepts are the same."
msgstr ""
-"在本章的剩余部分,我们假设我们正在创建一个二进制项目,而不是一个库项目,但所有的概念都是相同的。"
+"在本章的剩余部分,我们假设我们正在创建一个二进制项目,而不是一个库项目,但所"
+"有的概念都是相同的。"
#: src/cargo/deps.md:21
msgid "After the above commands, you should see a file hierarchy like this:"
@@ -6932,7 +7136,9 @@
"new there. The `Cargo.toml` is the config file for `cargo` for this project. "
"If you look inside it, you should see something like this:"
msgstr ""
-"`main.rs` 是你新建的 `foo` 项目的主源文件 —— 这一点没什么新鲜的。`Cargo.toml` 则是这个项目的 `cargo` 配置文件。如果你查看它的内容,应该会看到类似这样的内容:"
+"`main.rs` 是你新建的 `foo` 项目的主源文件 —— 这一点没什么新鲜的。"
+"`Cargo.toml` 则是这个项目的 `cargo` 配置文件。如果你查看它的内容,应该会看到"
+"类似这样的内容:"
#: src/cargo/deps.md:39
msgid ""
@@ -6960,7 +7166,9 @@
"is used by `crates.io` if you publish the crate (more later). It is also the "
"name of the output binary when you compile."
msgstr ""
-"`[package]` 下的 `name` 字段决定了项目的名称。如果你将 crate 发布到 `crates.io`(稍后会详细介绍),这个名称将被使用。同时,它也是编译时生成的二进制文件的名称。"
+"`[package]` 下的 `name` 字段决定了项目的名称。如果你将 crate 发布到 "
+"`crates.io`(稍后会详细介绍),这个名称将被使用。同时,它也是编译时生成的二进"
+"制文件的名称。"
#: src/cargo/deps.md:52
msgid ""
@@ -6970,31 +7178,40 @@
"`version` 字段是使用[语义化版本控制](http://semver.org/)的 crate 版本号。"
#: src/cargo/deps.md:55
-msgid "The `authors` field is a list of authors used when publishing the crate."
+msgid ""
+"The `authors` field is a list of authors used when publishing the crate."
msgstr "`authors` 字段是发布 crate 时使用的作者列表。"
#: src/cargo/deps.md:57
-msgid "The `[dependencies]` section lets you add dependencies for your project."
+msgid ""
+"The `[dependencies]` section lets you add dependencies for your project."
msgstr "`[dependencies]` 部分允许你为项目添加依赖。"
#: src/cargo/deps.md:59
msgid ""
"For example, suppose that we want our program to have a great CLI. You can "
"find lots of great packages on [crates.io](https://crates.io) (the official "
-"Rust package registry). One popular choice is [clap](https://crates.io/crates/"
-"clap). As of this writing, the most recent published version of `clap` is "
-"`2.27.1`. To add a dependency to our program, we can simply add the following "
-"to our `Cargo.toml` under `[dependencies]`: `clap = \"2.27.1\"`. And that's "
-"it! You can start using `clap` in your program."
+"Rust package registry). One popular choice is [clap](https://crates.io/"
+"crates/clap). As of this writing, the most recent published version of "
+"`clap` is `2.27.1`. To add a dependency to our program, we can simply add "
+"the following to our `Cargo.toml` under `[dependencies]`: `clap = "
+"\"2.27.1\"`. And that's it! You can start using `clap` in your program."
msgstr ""
-"举个例子,假设我们想让程序拥有一个出色的命令行界面(CLI)。你可以在 [crates.io](https://crates.io)(Rust 官方包注册中心)上找到许多优秀的包。其中,[clap](https://crates.io/crates/clap) 是一个广受欢迎的选择。在撰写本文时,`clap` 的最新发布版本是 `2.27.1`。要在我们的程序中添加这个依赖,只需在 `Cargo.toml` 的 `[dependencies]` 下添加:`clap = \"2.27.1\"`。就这么简单!现在你就可以在程序中使用 `clap` 了。"
+"举个例子,假设我们想让程序拥有一个出色的命令行界面(CLI)。你可以在 "
+"[crates.io](https://crates.io)(Rust 官方包注册中心)上找到许多优秀的包。其"
+"中,[clap](https://crates.io/crates/clap) 是一个广受欢迎的选择。在撰写本文"
+"时,`clap` 的最新发布版本是 `2.27.1`。要在我们的程序中添加这个依赖,只需在 "
+"`Cargo.toml` 的 `[dependencies]` 下添加:`clap = \"2.27.1\"`。就这么简单!现"
+"在你就可以在程序中使用 `clap` 了。"
#: src/cargo/deps.md:67
msgid ""
-"`cargo` also supports [other types of dependencies](https://doc.rust-lang.org/"
-"cargo/reference/specifying-dependencies.html). Here is just a small sampling:"
+"`cargo` also supports [other types of dependencies](https://doc.rust-"
+"lang.org/cargo/reference/specifying-dependencies.html). Here is just a small "
+"sampling:"
msgstr ""
-"`cargo` 还支持[其他类型的依赖](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html)。这里给出一个简单的示例:"
+"`cargo` 还支持[其他类型的依赖](https://doc.rust-lang.org/cargo/reference/"
+"specifying-dependencies.html)。这里给出一个简单的示例:"
#: src/cargo/deps.md:70
msgid ""
@@ -7019,17 +7236,19 @@
"\n"
"[dependencies]\n"
"clap = \"2.27.1\" # 来自 crates.io\n"
-"rand = { git = \"https://github.com/rust-lang-nursery/rand\" } # 来自在线仓库\n"
+"rand = { git = \"https://github.com/rust-lang-nursery/rand\" } # 来自在线仓"
+"库\n"
"bar = { path = \"../bar\" } # 来自本地文件系统的路径\n"
"```"
#: src/cargo/deps.md:82
msgid ""
-"`cargo` is more than a dependency manager. All of the available configuration "
-"options are listed in the [format specification](https://doc.rust-lang.org/"
-"cargo/reference/manifest.html) of `Cargo.toml`."
+"`cargo` is more than a dependency manager. All of the available "
+"configuration options are listed in the [format specification](https://"
+"doc.rust-lang.org/cargo/reference/manifest.html) of `Cargo.toml`."
msgstr ""
-"`cargo` 不仅仅是一个依赖管理器。`Cargo.toml` 的[格式规范](https://doc.rust-lang.org/cargo/reference/manifest.html)中列出了所有可用的配置选项。"
+"`cargo` 不仅仅是一个依赖管理器。`Cargo.toml` 的[格式规范](https://doc.rust-"
+"lang.org/cargo/reference/manifest.html)中列出了所有可用的配置选项。"
#: src/cargo/deps.md:86
msgid ""
@@ -7039,7 +7258,10 @@
"crates if needed, and build everything, including your crate. (Note that it "
"only rebuilds what it has not already built, similar to `make`)."
msgstr ""
-"我们可以在项目目录的任何位置(包括子目录!)执行 `cargo build` 来构建项目。也可以使用 `cargo run` 来构建并运行。请注意,这些命令会解析所有依赖,必要时下载 crate,并构建所有内容,包括你的 crate。(值得一提的是,它只会重新构建尚未构建的部分,类似于 `make`)。"
+"我们可以在项目目录的任何位置(包括子目录!)执行 `cargo build` 来构建项目。也"
+"可以使用 `cargo run` 来构建并运行。请注意,这些命令会解析所有依赖,必要时下"
+"载 crate,并构建所有内容,包括你的 crate。(值得一提的是,它只会重新构建尚未"
+"构建的部分,类似于 `make`)。"
#: src/cargo/deps.md:92
msgid "Voila! That's all there is to it!"
@@ -7051,8 +7273,8 @@
#: src/cargo/conventions.md:12
msgid ""
-"Suppose that we wanted to have two binaries in the same project, though. What "
-"then?"
+"Suppose that we wanted to have two binaries in the same project, though. "
+"What then?"
msgstr "那么,如果我们想在同一个项目中包含两个二进制文件,该怎么办呢?"
#: src/cargo/conventions.md:15
@@ -7061,8 +7283,8 @@
"as we saw before, but you can add additional binaries by placing them in a "
"`bin/` directory:"
msgstr ""
-"`cargo` 实际上支持这种需求。如我们之前所见,默认的二进制文件名是 `main`,"
-"但你可以通过在 `bin/` 目录中放置额外的文件来添加其他二进制文件:"
+"`cargo` 实际上支持这种需求。如我们之前所见,默认的二进制文件名是 `main`,但你"
+"可以通过在 `bin/` 目录中放置额外的文件来添加其他二进制文件:"
#: src/cargo/conventions.md:28
msgid ""
@@ -7070,17 +7292,17 @@
"`--bin my_other_bin` flag, where `my_other_bin` is the name of the binary we "
"want to work with."
msgstr ""
-"如果要指示 `cargo` 只编译或运行特定的二进制文件,只需传递 `--bin my_other_bin` 标志,"
-"其中 `my_other_bin` 是我们想要处理的二进制文件的名称。"
+"如果要指示 `cargo` 只编译或运行特定的二进制文件,只需传递 `--bin "
+"my_other_bin` 标志,其中 `my_other_bin` 是我们想要处理的二进制文件的名称。"
#: src/cargo/conventions.md:32
msgid ""
-"In addition to extra binaries, `cargo` supports [more features](https://doc."
-"rust-lang.org/cargo/guide/project-layout.html) such as benchmarks, tests, and "
-"examples."
+"In addition to extra binaries, `cargo` supports [more features](https://"
+"doc.rust-lang.org/cargo/guide/project-layout.html) such as benchmarks, "
+"tests, and examples."
msgstr ""
-"除了额外的二进制文件,`cargo` 还支持[更多功能](https://doc.rust-lang.org/cargo/guide/project-layout.html),"
-"如基准测试、测试和示例。"
+"除了额外的二进制文件,`cargo` 还支持[更多功能](https://doc.rust-lang.org/"
+"cargo/guide/project-layout.html),如基准测试、测试和示例。"
#: src/cargo/conventions.md:35
msgid "In the next chapter, we will look more closely at tests."
@@ -7088,50 +7310,54 @@
#: src/cargo/test.md:3
msgid ""
-"As we know testing is integral to any piece of software! Rust has first-class "
-"support for unit and integration testing ([see this chapter](https://doc.rust-"
-"lang.org/book/ch11-00-testing.html) in TRPL)."
+"As we know testing is integral to any piece of software! Rust has first-"
+"class support for unit and integration testing ([see this chapter](https://"
+"doc.rust-lang.org/book/ch11-00-testing.html) in TRPL)."
msgstr ""
-"众所周知,测试是任何软件不可或缺的一部分!Rust 为单元测试和集成测试提供了一流的支持"
-"(参见《Rust 程序设计语言》中的[这一章](https://doc.rust-lang.org/book/ch11-00-testing.html))。"
+"众所周知,测试是任何软件不可或缺的一部分!Rust 为单元测试和集成测试提供了一流"
+"的支持(参见《Rust 程序设计语言》中的[这一章](https://doc.rust-lang.org/book/"
+"ch11-00-testing.html))。"
-#: src/cargo/test.md:8
+#: src/cargo/test.md:7
msgid ""
"From the testing chapters linked above, we see how to write unit tests and "
"integration tests. Organizationally, we can place unit tests in the modules "
"they test and integration tests in their own `tests/` directory:"
msgstr ""
"从上面链接的测试章节中,我们了解了如何编写单元测试和集成测试。在组织结构上,"
-"我们可以将单元测试放在它们所测试的模块中,而将集成测试放在专门的 `tests/` 目录中:"
+"我们可以将单元测试放在它们所测试的模块中,而将集成测试放在专门的 `tests/` 目"
+"录中:"
-#: src/cargo/test.md:23
+#: src/cargo/test.md:22
msgid ""
-"Each file in `tests` is a separate [integration test](https://doc.rust-lang."
-"org/book/ch11-03-test-organization.html#integration-tests), i.e. a test that "
-"is meant to test your library as if it were being called from a dependent "
-"crate."
+"Each file in `tests` is a separate [integration test](https://doc.rust-"
+"lang.org/book/ch11-03-test-organization.html#integration-tests), i.e. a test "
+"that is meant to test your library as if it were being called from a "
+"dependent crate."
msgstr ""
-"`tests` 目录中的每个文件都是一个独立的[集成测试](https://doc.rust-lang.org/book/ch11-03-test-organization.html#integration-tests),"
-"即旨在测试你的库,就像它被依赖的 crate 调用一样。"
+"`tests` 目录中的每个文件都是一个独立的[集成测试](https://doc.rust-lang.org/"
+"book/ch11-03-test-organization.html#integration-tests),即旨在测试你的库,就"
+"像它被依赖的 crate 调用一样。"
-#: src/cargo/test.md:28
+#: src/cargo/test.md:27
msgid ""
"The [Testing](../testing.md) chapter elaborates on the three different "
"testing styles: [Unit](../testing/unit_testing.md), [Doc](../testing/"
"doc_testing.md), and [Integration](../testing/integration_testing.md)."
msgstr ""
-"[测试](../testing.md)章节详细阐述了三种不同的测试风格:[单元测试](../testing/unit_testing.md)、"
-"[文档测试](../testing/doc_testing.md)和[集成测试](../testing/integration_testing.md)。"
+"[测试](../testing.md)章节详细阐述了三种不同的测试风格:[单元测试](../testing/"
+"unit_testing.md)、[文档测试](../testing/doc_testing.md)和[集成测试](../"
+"testing/integration_testing.md)。"
-#: src/cargo/test.md:31
+#: src/cargo/test.md:30
msgid "`cargo` naturally provides an easy way to run all of your tests!"
msgstr "`cargo` 自然提供了一种简便的方式来运行所有测试!"
-#: src/cargo/test.md:37
+#: src/cargo/test.md:36
msgid "You should see output like this:"
msgstr "你将看到类似这样的输出:"
-#: src/cargo/test.md:39
+#: src/cargo/test.md:38
msgid ""
"```shell\n"
"$ cargo test\n"
@@ -7163,11 +7389,11 @@
"test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\n"
"```"
-#: src/cargo/test.md:54
+#: src/cargo/test.md:53
msgid "You can also run tests whose name matches a pattern:"
msgstr "你还可以运行名称匹配特定模式的测试:"
-#: src/cargo/test.md:60
+#: src/cargo/test.md:59
msgid ""
"```shell\n"
"$ cargo test test_foo\n"
@@ -7195,85 +7421,88 @@
"test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out\n"
"```"
-#: src/cargo/test.md:73
+#: src/cargo/test.md:72
msgid ""
"One word of caution: Cargo may run multiple tests concurrently, so make sure "
"that they don't race with each other."
-msgstr "需要注意:Cargo 可能会并发运行多个测试,因此请确保它们之间不会产生竞态条件。"
+msgstr ""
+"需要注意:Cargo 可能会并发运行多个测试,因此请确保它们之间不会产生竞态条件。"
-#: src/cargo/test.md:76
+#: src/cargo/test.md:75
msgid ""
"One example of this concurrency causing issues is if two tests output to a "
"file, such as below:"
-msgstr "并发可能导致问题的一个例子是,如果两个测试同时输出到同一个文件,如下所示:"
+msgstr ""
+"并发可能导致问题的一个例子是,如果两个测试同时输出到同一个文件,如下所示:"
-#: src/cargo/test.md:82
+#: src/cargo/test.md:81
msgid "// Import the necessary modules\n"
msgstr "// 导入必要的模块\n"
-#: src/cargo/test.md:86
+#: src/cargo/test.md:85
msgid "// This test writes to a file\n"
msgstr "// 这个测试向文件写入内容\n"
-#: src/cargo/test.md:89 src/cargo/test.md:106
+#: src/cargo/test.md:88 src/cargo/test.md:105
msgid "// Opens the file ferris.txt or creates one if it doesn't exist.\n"
msgstr "// 打开 ferris.txt 文件,如果不存在则创建一个\n"
-#: src/cargo/test.md:93 src/cargo/test.md:110
+#: src/cargo/test.md:92 src/cargo/test.md:109
msgid "\"ferris.txt\""
msgstr "\"ferris.txt\""
-#: src/cargo/test.md:94 src/cargo/test.md:111
+#: src/cargo/test.md:93 src/cargo/test.md:110
msgid "\"Failed to open ferris.txt\""
msgstr "\"无法打开 ferris.txt\""
-#: src/cargo/test.md:96
+#: src/cargo/test.md:95
msgid "// Print \"Ferris\" 5 times.\n"
msgstr "// 循环打印 \"Ferris\" 5 次\n"
-#: src/cargo/test.md:98
+#: src/cargo/test.md:97
msgid "\"Ferris\\n\""
msgstr "\"Ferris\\n\""
-#: src/cargo/test.md:99 src/cargo/test.md:116
+#: src/cargo/test.md:98 src/cargo/test.md:115
msgid "\"Could not write to ferris.txt\""
msgstr "\"无法写入 ferris.txt\""
-#: src/cargo/test.md:103
+#: src/cargo/test.md:102
msgid "// This test tries to write to the same file\n"
msgstr "// 这个测试尝试写入同一个文件\n"
-#: src/cargo/test.md:113
+#: src/cargo/test.md:112
msgid "// Print \"Corro\" 5 times.\n"
msgstr "// 循环打印 \"Corro\" 5 次\n"
-#: src/cargo/test.md:115
+#: src/cargo/test.md:114
msgid "\"Corro\\n\""
msgstr "\"Corro\\n\""
-#: src/cargo/test.md:122
+#: src/cargo/test.md:121
msgid "Although the intent is to get the following:"
msgstr "尽管预期结果应该是:"
-#: src/cargo/test.md:136
+#: src/cargo/test.md:137
msgid "What actually gets put into `ferris.txt` is this:"
msgstr "但实际写入 `ferris.txt` 的内容可能是这样的:"
#: src/cargo/build_scripts.md:3
msgid ""
-"Sometimes a normal build from `cargo` is not enough. Perhaps your crate needs "
-"some pre-requisites before `cargo` will successfully compile, things like "
-"code generation, or some native code that needs to be compiled. To solve this "
-"problem we have build scripts that Cargo can run."
+"Sometimes a normal build from `cargo` is not enough. Perhaps your crate "
+"needs some pre-requisites before `cargo` will successfully compile, things "
+"like code generation, or some native code that needs to be compiled. To "
+"solve this problem we have build scripts that Cargo can run."
msgstr ""
-"有时候,`cargo` 的常规构建可能不足以满足需求。你的 crate 可能在 `cargo` 成功编译之前需要一些先决条件,比如代码生成,或者需要编译一些本地代码。为了解决这个问题,我们可以使用 Cargo 能够运行的构建脚本。"
+"有时候,`cargo` 的常规构建可能不足以满足需求。你的 crate 可能在 `cargo` 成功"
+"编译之前需要一些先决条件,比如代码生成,或者需要编译一些本地代码。为了解决这"
+"个问题,我们可以使用 Cargo 能够运行的构建脚本。"
#: src/cargo/build_scripts.md:8
msgid ""
"To add a build script to your package it can either be specified in the "
"`Cargo.toml` as follows:"
-msgstr ""
-"要为你的包添加构建脚本,可以在 `Cargo.toml` 中指定,如下所示:"
+msgstr "要为你的包添加构建脚本,可以在 `Cargo.toml` 中指定,如下所示:"
#: src/cargo/build_scripts.md:11
msgid ""
@@ -7293,8 +7522,7 @@
msgid ""
"Otherwise Cargo will look for a `build.rs` file in the project directory by "
"default."
-msgstr ""
-"如果没有指定,Cargo 默认会在项目目录中查找 `build.rs` 文件。"
+msgstr "如果没有指定,Cargo 默认会在项目目录中查找 `build.rs` 文件。"
#: src/cargo/build_scripts.md:20
msgid "How to use a build script"
@@ -7303,42 +7531,47 @@
#: src/cargo/build_scripts.md:22
msgid ""
"The build script is simply another Rust file that will be compiled and "
-"invoked prior to compiling anything else in the package. Hence it can be used "
-"to fulfill pre-requisites of your crate."
+"invoked prior to compiling anything else in the package. Hence it can be "
+"used to fulfill pre-requisites of your crate."
msgstr ""
-"构建脚本只是另一个 Rust 文件,它会在编译包中的其他内容之前被编译和调用。因此,它可以用来满足你的 crate 的先决条件。"
+"构建脚本只是另一个 Rust 文件,它会在编译包中的其他内容之前被编译和调用。因"
+"此,它可以用来满足你的 crate 的先决条件。"
#: src/cargo/build_scripts.md:26
msgid ""
"Cargo provides the script with inputs via environment variables [specified "
-"here](https://doc.rust-lang.org/cargo/reference/environment-variables."
-"html#environment-variables-cargo-sets-for-build-scripts) that can be used."
+"here](https://doc.rust-lang.org/cargo/reference/environment-"
+"variables.html#environment-variables-cargo-sets-for-build-scripts) that can "
+"be used."
msgstr ""
-"Cargo 通过环境变量为脚本提供输入,这些环境变量可以被使用。具体参见[这里的说明](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)。"
+"Cargo 通过环境变量为脚本提供输入,这些环境变量可以被使用。具体参见[这里的说"
+"明](https://doc.rust-lang.org/cargo/reference/environment-"
+"variables.html#environment-variables-cargo-sets-for-build-scripts)。"
#: src/cargo/build_scripts.md:29
msgid ""
"The script provides output via stdout. All lines printed are written to "
-"`target/debug/build/<pkg>/output`. Further, lines prefixed with `cargo:` will "
-"be interpreted by Cargo directly and hence can be used to define parameters "
-"for the package's compilation."
+"`target/debug/build/<pkg>/output`. Further, lines prefixed with `cargo:` "
+"will be interpreted by Cargo directly and hence can be used to define "
+"parameters for the package's compilation."
msgstr ""
-"脚本通过标准输出提供输出。所有打印的行都会被写入 `target/debug/build/<pkg>/output`。此外,以 `cargo:` 为前缀的行会被 Cargo 直接解释,因此可以用来为包的编译定义参数。"
+"脚本通过标准输出提供输出。所有打印的行都会被写入 `target/debug/build/<pkg>/"
+"output`。此外,以 `cargo:` 为前缀的行会被 Cargo 直接解释,因此可以用来为包的"
+"编译定义参数。"
#: src/cargo/build_scripts.md:34
msgid ""
"For further specification and examples have a read of the [Cargo "
"specification](https://doc.rust-lang.org/cargo/reference/build-scripts.html)."
msgstr ""
-"如需了解更多详细规范和示例,请参阅 [Cargo 构建脚本规范]"
-"(https://doc.rust-lang.org/cargo/reference/build-scripts.html)。"
+"如需了解更多详细规范和示例,请参阅 [Cargo 构建脚本规范](https://doc.rust-"
+"lang.org/cargo/reference/build-scripts.html)。"
#: src/attribute.md:3
msgid ""
-"An attribute is metadata applied to some module, crate or item. This metadata "
-"can be used to/for:"
-msgstr ""
-"属性是应用于模块、crate 或条目的元数据。这些元数据可用于以下目的:"
+"An attribute is metadata applied to some module, crate or item. This "
+"metadata can be used to/for:"
+msgstr "属性是应用于模块、crate 或条目的元数据。这些元数据可用于以下目的:"
#: src/attribute.md:8
msgid "[conditional compilation of code](attribute/cfg.md)"
@@ -7352,7 +7585,8 @@
#: src/attribute.md:10
msgid ""
"disable [lints](https://en.wikipedia.org/wiki/Lint_%28software%29) (warnings)"
-msgstr "禁用 [代码检查](https://en.wikipedia.org/wiki/Lint_%28software%29)(警告)"
+msgstr ""
+"禁用 [代码检查](https://en.wikipedia.org/wiki/Lint_%28software%29)(警告)"
#: src/attribute.md:11
msgid "enable compiler features (macros, glob imports, etc.)"
@@ -7372,67 +7606,69 @@
#: src/attribute.md:15
msgid ""
-"[attribute like macros](https://doc.rust-lang.org/book/ch19-06-macros."
-"html#attribute-like-macros)"
+"[attribute like macros](https://doc.rust-lang.org/book/ch19-06-"
+"macros.html#attribute-like-macros)"
msgstr ""
-"[类属性宏](https://doc.rust-lang.org/book/ch19-06-macros.html#attribute-like-macros)"
+"[类属性宏](https://doc.rust-lang.org/book/ch19-06-macros.html#attribute-like-"
+"macros)"
#: src/attribute.md:17
msgid ""
"Attributes look like `#[outer_attribute]` or `#![inner_attribute]`, with the "
"difference between them being where they apply."
msgstr ""
-"属性的形式为 `#[outer_attribute]`(外部属性)或 `#![inner_attribute]`(内部属性),"
-"它们的区别在于应用的位置。"
+"属性的形式为 `#[outer_attribute]`(外部属性)或 `#![inner_attribute]`(内部属"
+"性),它们的区别在于应用的位置。"
#: src/attribute.md:20
msgid ""
"`#[outer_attribute]` applies to the [item](https://doc.rust-lang.org/stable/"
-"reference/items.html) immediately following it. Some examples of items are: a "
-"function, a module declaration, a constant, a structure, an enum. Here is an "
-"example where attribute `#[derive(Debug)]` applies to the struct `Rectangle`:"
+"reference/items.html) immediately following it. Some examples of items are: "
+"a function, a module declaration, a constant, a structure, an enum. Here is "
+"an example where attribute `#[derive(Debug)]` applies to the struct "
+"`Rectangle`:"
msgstr ""
"`#[outer_attribute]` 应用于紧随其后的[条目](https://doc.rust-lang.org/stable/"
"reference/items.html)。条目的例子包括:函数、模块声明、常量、结构体、枚举等。"
"以下是一个示例,其中属性 `#[derive(Debug)]` 应用于结构体 `Rectangle`:"
-#: src/attribute.md:33
+#: src/attribute.md:34
msgid ""
-"`#![inner_attribute]` applies to the enclosing [item](https://doc.rust-lang."
-"org/stable/reference/items.html) (typically a module or a crate). In other "
-"words, this attribute is interpreted as applying to the entire scope in which "
-"it's placed. Here is an example where `#![allow(unused_variables)]` applies "
-"to the whole crate (if placed in `main.rs`):"
+"`#![inner_attribute]` applies to the enclosing [item](https://doc.rust-"
+"lang.org/stable/reference/items.html) (typically a module or a crate). In "
+"other words, this attribute is interpreted as applying to the entire scope "
+"in which it's placed. Here is an example where `#![allow(unused_variables)]` "
+"applies to the whole crate (if placed in `main.rs`):"
msgstr ""
"`#![inner_attribute]` 应用于包含它的[条目](https://doc.rust-lang.org/stable/"
"reference/items.html)(通常是模块或 crate)。换句话说,这种属性被解释为应用于"
"它所在的整个作用域。以下是一个示例,其中 `#![allow(unused_variables)]` 应用于"
"整个 crate(如果放置在 `main.rs` 中):"
-#: src/attribute.md:42
+#: src/attribute.md:44
msgid "// This would normally warn about an unused variable.\n"
msgstr "// 这通常会警告未使用的变量。\n"
-#: src/attribute.md:46
+#: src/attribute.md:48
msgid "Attributes can take arguments with different syntaxes:"
msgstr "属性可以使用不同的语法接受参数:"
-#: src/attribute.md:48
+#: src/attribute.md:50
msgid "`#[attribute = \"value\"]`"
msgstr "`#[attribute = \"value\"]`"
-#: src/attribute.md:49
+#: src/attribute.md:51
msgid "`#[attribute(key = \"value\")]`"
msgstr "`#[attribute(key = \"value\")]`"
-#: src/attribute.md:50
+#: src/attribute.md:52
msgid "`#[attribute(value)]`"
msgstr "`#[attribute(value)]`"
-#: src/attribute.md:52
+#: src/attribute.md:54
msgid ""
-"Attributes can have multiple values and can be separated over multiple lines, "
-"too:"
+"Attributes can have multiple values and can be separated over multiple "
+"lines, too:"
msgstr "属性可以有多个值,也可以跨多行分隔:"
#: src/attribute/unused.md:3
@@ -7447,22 +7683,20 @@
#: src/attribute/unused.md:9
msgid ""
"// `#[allow(dead_code)]` is an attribute that disables the `dead_code` lint\n"
-msgstr ""
-"// `#[allow(dead_code)]` 是一个用于禁用 `dead_code` lint 的属性\n"
+msgstr "// `#[allow(dead_code)]` 是一个用于禁用 `dead_code` lint 的属性\n"
#: src/attribute/unused.md:14
msgid "// FIXME ^ Add an attribute to suppress the warning\n"
-msgstr ""
-"// FIXME ^ 添加一个属性来抑制警告\n"
+msgstr "// FIXME ^ 添加一个属性来抑制警告\n"
#: src/attribute/unused.md:22
msgid ""
-"Note that in real programs, you should eliminate dead code. In these examples "
-"we'll allow dead code in some places because of the interactive nature of the "
-"examples."
+"Note that in real programs, you should eliminate dead code. In these "
+"examples we'll allow dead code in some places because of the interactive "
+"nature of the examples."
msgstr ""
-"注意,在实际程序中,你应该消除无用代码。在这些示例中,我们会在某些地方允许存在"
-"无用代码,这是因为这些示例具有交互性质。"
+"注意,在实际程序中,你应该消除无用代码。在这些示例中,我们会在某些地方允许存"
+"在无用代码,这是因为这些示例具有交互性质。"
#: src/attribute/crate.md:3
msgid ""
@@ -7470,8 +7704,8 @@
"is a binary or a library (and even which type of library), and the "
"`crate_name` attribute can be used to set the name of the crate."
msgstr ""
-"`crate_type` 属性可用于告诉编译器一个 crate 是二进制文件还是库(甚至是哪种类型"
-"的库),而 `crate_name` 属性可用于设置 crate 的名称。"
+"`crate_type` 属性可用于告诉编译器一个 crate 是二进制文件还是库(甚至是哪种类"
+"型的库),而 `crate_name` 属性可用于设置 crate 的名称。"
#: src/attribute/crate.md:7
msgid ""
@@ -7481,13 +7715,12 @@
"real-world uses of `crate_type` and `crate_name` are relatively limited."
msgstr ""
"然而,需要注意的是,当使用 Rust 的包管理器 Cargo 时,`crate_type` 和 "
-"`crate_name` 属性**完全不起作用**。由于大多数 Rust 项目都使用 Cargo,这意味着 "
-"`crate_type` 和 `crate_name` 在实际使用中的应用相对有限。"
+"`crate_name` 属性**完全不起作用**。由于大多数 Rust 项目都使用 Cargo,这意味"
+"着 `crate_type` 和 `crate_name` 在实际使用中的应用相对有限。"
#: src/attribute/crate.md:13
msgid "// This crate is a library\n"
-msgstr ""
-"// 这个 crate 是一个库\n"
+msgstr "// 这个 crate 是一个库\n"
#: src/attribute/crate.md:14
msgid "\"lib\""
@@ -7495,8 +7728,7 @@
#: src/attribute/crate.md:14
msgid "// The library is named \"rary\"\n"
-msgstr ""
-"// 这个库的名称是 \"rary\"\n"
+msgstr "// 这个库的名称是 \"rary\"\n"
#: src/attribute/crate.md:16
msgid "\"rary\""
@@ -7507,13 +7739,14 @@
"When the `crate_type` attribute is used, we no longer need to pass the `--"
"crate-type` flag to `rustc`."
msgstr ""
-"当使用 `crate_type` 属性时,我们就不再需要向 `rustc` 传递 `--crate-type` 标志。"
+"当使用 `crate_type` 属性时,我们就不再需要向 `rustc` 传递 `--crate-type` 标"
+"志。"
#: src/attribute/cfg.md:3
msgid ""
-"Configuration conditional checks are possible through two different operators:"
-msgstr ""
-"配置条件检查可以通过两种不同的操作符实现:"
+"Configuration conditional checks are possible through two different "
+"operators:"
+msgstr "配置条件检查可以通过两种不同的操作符实现:"
#: src/attribute/cfg.md:5
msgid "the `cfg` attribute: `#[cfg(...)]` in attribute position"
@@ -7526,8 +7759,8 @@
#: src/attribute/cfg.md:8
msgid ""
"While the former enables conditional compilation, the latter conditionally "
-"evaluates to `true` or `false` literals allowing for checks at run-time. Both "
-"utilize identical argument syntax."
+"evaluates to `true` or `false` literals allowing for checks at run-time. "
+"Both utilize identical argument syntax."
msgstr ""
"前者启用条件编译,后者在运行时条件性地求值为 `true` 或 `false` 字面量,允许在"
"运行时进行检查。两者使用相同的参数语法。"
@@ -7540,13 +7773,12 @@
"evaluating."
msgstr ""
"`cfg!` 与 `#[cfg]` 不同,它不会移除任何代码,只会求值为 true 或 false。例如,"
-"当 `cfg!` 用于条件时,if/else 表达式中的所有代码块都需要是有效的,无论 `cfg!` "
-"正在评估什么。"
+"当 `cfg!` 用于条件时,if/else 表达式中的所有代码块都需要是有效的,无论 `cfg!"
+"` 正在评估什么。"
#: src/attribute/cfg.md:15
msgid "// This function only gets compiled if the target OS is linux\n"
-msgstr ""
-"// 这个函数只有在目标操作系统是 linux 时才会被编译\n"
+msgstr "// 这个函数只有在目标操作系统是 linux 时才会被编译\n"
#: src/attribute/cfg.md:16 src/attribute/cfg.md:22 src/attribute/cfg.md:31
msgid "\"linux\""
@@ -7579,18 +7811,21 @@
#: src/attribute/cfg.md:41
msgid ""
-"[the reference](https://doc.rust-lang.org/reference/attributes."
-"html#conditional-compilation), [`cfg!`](https://doc.rust-lang.org/std/macro."
-"cfg!.html), and [macros](../macros.md)."
+"[the reference](https://doc.rust-lang.org/reference/"
+"attributes.html#conditional-compilation), [`cfg!`](https://doc.rust-lang.org/"
+"std/macro.cfg!.html), and [macros](../macros.md)."
msgstr ""
-"[参考文档](https://doc.rust-lang.org/reference/attributes.html#conditional-compilation)、[`cfg!` 宏](https://doc.rust-lang.org/std/macro.cfg!.html)和[宏](../macros.md)。"
+"[参考文档](https://doc.rust-lang.org/reference/attributes.html#conditional-"
+"compilation)、[`cfg!` 宏](https://doc.rust-lang.org/std/macro.cfg!.html)和"
+"[宏](../macros.md)。"
#: src/attribute/cfg/custom.md:3
msgid ""
"Some conditionals like `target_os` are implicitly provided by `rustc`, but "
"custom conditionals must be passed to `rustc` using the `--cfg` flag."
msgstr ""
-"一些条件(如 `target_os`)是由 `rustc` 隐式提供的,但自定义条件必须通过 `--cfg` 标志传递给 `rustc`。"
+"一些条件(如 `target_os`)是由 `rustc` 隐式提供的,但自定义条件必须通过 `--"
+"cfg` 标志传递给 `rustc`。"
#: src/attribute/cfg/custom.md:9
msgid "\"condition met!\""
@@ -7613,38 +7848,40 @@
"considered valid. The simplest and most common use of generics is for type "
"parameters."
msgstr ""
-"**泛型**是一个关于将类型和功能泛化以适用于更广泛情况的主题。这在多方面都非常有用,可以大大减少代码重复,"
-"但可能需要相对复杂的语法。具体来说,使用泛型需要非常谨慎地指定泛型类型在哪些类型上是有效的。"
-"泛型最简单和最常见的用途是类型参数。"
+"**泛型**是一个关于将类型和功能泛化以适用于更广泛情况的主题。这在多方面都非常"
+"有用,可以大大减少代码重复,但可能需要相对复杂的语法。具体来说,使用泛型需要"
+"非常谨慎地指定泛型类型在哪些类型上是有效的。泛型最简单和最常见的用途是类型参"
+"数。"
#: src/generics.md:10
msgid ""
"A type parameter is specified as generic by the use of angle brackets and "
-"upper [camel case](https://en.wikipedia.org/wiki/CamelCase): `<Aaa, Bbb, ..."
-">`. \"Generic type parameters\" are typically represented as `<T>`. In Rust, "
-"\"generic\" also describes anything that accepts one or more generic type "
-"parameters `<T>`. Any type specified as a generic type parameter is generic, "
-"and everything else is concrete (non-generic)."
+"upper [camel case](https://en.wikipedia.org/wiki/CamelCase): `<Aaa, "
+"Bbb, ...>`. \"Generic type parameters\" are typically represented as `<T>`. "
+"In Rust, \"generic\" also describes anything that accepts one or more "
+"generic type parameters `<T>`. Any type specified as a generic type "
+"parameter is generic, and everything else is concrete (non-generic)."
msgstr ""
-"类型参数通过使用尖括号和大写[驼峰命名法](https://en.wikipedia.org/wiki/CamelCase)来指定为泛型:`<Aaa, Bbb, ...>`。"
-""泛型类型参数"通常表示为 `<T>`。在 Rust 中,"泛型"也用来描述任何接受一个或多个泛型类型参数 `<T>` 的东西。"
-"任何被指定为泛型类型参数的类型都是泛型的,而其他所有类型都是具体的(非泛型)。"
+"类型参数通过使用尖括号和大写[驼峰命名法](https://en.wikipedia.org/wiki/"
+"CamelCase)来指定为泛型:`<Aaa, Bbb, ...>`。\"泛型类型参数\"通常表示为 `<T>`。"
+"在 Rust 中,\"泛型\"也用来描述任何接受一个或多个泛型类型参数 `<T>` 的东西。任"
+"何被指定为泛型类型参数的类型都是泛型的,而其他所有类型都是具体的(非泛型)。"
#: src/generics.md:16
msgid ""
-"For example, defining a _generic function_ named `foo` that takes an argument "
-"`T` of any type:"
+"For example, defining a _generic function_ named `foo` that takes an "
+"argument `T` of any type:"
msgstr ""
"例如,定义一个名为 `foo` 的**泛型函数**,它接受一个任意类型的参数 `T`:"
#: src/generics.md:23
msgid ""
-"Because `T` has been specified as a generic type parameter using `<T>`, it is "
-"considered generic when used here as `(arg: T)`. This is the case even if `T` "
-"has previously been defined as a `struct`."
+"Because `T` has been specified as a generic type parameter using `<T>`, it "
+"is considered generic when used here as `(arg: T)`. This is the case even if "
+"`T` has previously been defined as a `struct`."
msgstr ""
-"因为 `T` 已经使用 `<T>` 指定为泛型类型参数,所以在这里用作 `(arg: T)` 时被视为泛型。"
-"即使 `T` 之前已被定义为一个 `struct`,这种情况也成立。"
+"因为 `T` 已经使用 `<T>` 指定为泛型类型参数,所以在这里用作 `(arg: T)` 时被视"
+"为泛型。即使 `T` 之前已被定义为一个 `struct`,这种情况也成立。"
#: src/generics.md:27
msgid "This example shows some of the syntax in action:"
@@ -7715,10 +7952,9 @@
#: src/generics/gen_fn.md:3
msgid ""
-"The same set of rules can be applied to functions: a type `T` becomes generic "
-"when preceded by `<T>`."
-msgstr ""
-"同样的规则也适用于函数:当类型 `T` 前面加上 `<T>` 时,它就变成了泛型。"
+"The same set of rules can be applied to functions: a type `T` becomes "
+"generic when preceded by `<T>`."
+msgstr "同样的规则也适用于函数:当类型 `T` 前面加上 `<T>` 时,它就变成了泛型。"
#: src/generics/gen_fn.md:6
msgid ""
@@ -7727,15 +7963,14 @@
"type is generic, or if the compiler doesn't have enough information to infer "
"the necessary type parameters."
msgstr ""
-"使用泛型函数有时需要明确指定类型参数。这种情况可能出现在函数返回类型是泛型时,"
-"或者编译器没有足够信息推断必要的类型参数时。"
+"使用泛型函数有时需要明确指定类型参数。这种情况可能出现在函数返回类型是泛型"
+"时,或者编译器没有足够信息推断必要的类型参数时。"
#: src/generics/gen_fn.md:11
msgid ""
"A function call with explicitly specified type parameters looks like: `fun::"
"<A, B, ...>()`."
-msgstr ""
-"明确指定类型参数的函数调用看起来像这样:`fun::<A, B, ...>()`。"
+msgstr "明确指定类型参数的函数调用看起来像这样:`fun::<A, B, ...>()`。"
#: src/generics/gen_fn.md:15
msgid "// Concrete type `A`.\n"
@@ -7782,8 +8017,8 @@
msgid ""
"// Define a function `gen_spec_i32` that takes an argument `_s` of type "
"`SGen<i32>`.\n"
-"// It has been explicitly given the type parameter `i32`, which is a specific "
-"type.\n"
+"// It has been explicitly given the type parameter `i32`, which is a "
+"specific type.\n"
"// Because `i32` is not a generic type, this function is also not generic.\n"
msgstr ""
"// 定义函数 `gen_spec_i32`,接受一个 `SGen<i32>` 类型的参数 `_s`\n"
@@ -7873,15 +8108,17 @@
"[functions returning references](../scope/lifetime/fn.md), [`impl`](../fn/"
"methods.md), and [`struct`](../custom_types/structs.md)"
msgstr ""
-"[返回引用的函数](../scope/lifetime/fn.md)、[`impl`](../fn/methods.md) 和[结构体](../custom_types/structs.md)"
+"[返回引用的函数](../scope/lifetime/fn.md)、[`impl`](../fn/methods.md) 和[结构"
+"体](../custom_types/structs.md)"
#: src/generics/gen_trait.md:3
msgid ""
-"Of course `trait`s can also be generic. Here we define one which reimplements "
-"the `Drop` `trait` as a generic method to `drop` itself and an input."
+"Of course `trait`s can also be generic. Here we define one which "
+"reimplements the `Drop` `trait` as a generic method to `drop` itself and an "
+"input."
msgstr ""
-"当然,`trait` 也可以是泛型的。这里我们定义了一个泛型 trait,它重新实现了 `Drop` trait,"
-"用于释放自身和一个输入参数。"
+"当然,`trait` 也可以是泛型的。这里我们定义了一个泛型 trait,它重新实现了 "
+"`Drop` trait,用于释放自身和一个输入参数。"
#: src/generics/gen_trait.md:7
msgid "// Non-copyable types.\n"
@@ -7903,8 +8140,7 @@
msgid ""
"// Implement `DoubleDrop<T>` for any generic parameter `T` and\n"
"// caller `U`.\n"
-msgstr ""
-"// 为任意泛型参数 `T` 和调用者 `U` 实现 `DoubleDrop<T>`。\n"
+msgstr "// 为任意泛型参数 `T` 和调用者 `U` 实现 `DoubleDrop<T>`。\n"
#: src/generics/gen_trait.md:21
msgid ""
@@ -7933,18 +8169,19 @@
"[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html), [`struct`](../"
"custom_types/structs.md), and [`trait`](../trait.md)"
msgstr ""
-"[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html)、[`struct`](../custom_types/structs.md) 和 [`trait`](../trait.md)"
+"[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html)、[`struct`](../"
+"custom_types/structs.md) 和 [`trait`](../trait.md)"
#: src/generics/bounds.md:3
msgid ""
"When working with generics, the type parameters often must use traits as "
"_bounds_ to stipulate what functionality a type implements. For example, the "
-"following example uses the trait `Display` to print and so it requires `T` to "
-"be bound by `Display`; that is, `T` _must_ implement `Display`."
+"following example uses the trait `Display` to print and so it requires `T` "
+"to be bound by `Display`; that is, `T` _must_ implement `Display`."
msgstr ""
-"在使用泛型时,类型参数通常需要使用 trait 作为**约束**,以规定类型应实现哪些功能。"
-"例如,下面的示例使用 `Display` trait 来打印,因此它要求 `T` 必须受 `Display` 约束;"
-"换句话说,`T` **必须**实现 `Display`。"
+"在使用泛型时,类型参数通常需要使用 trait 作为**约束**,以规定类型应实现哪些功"
+"能。例如,下面的示例使用 `Display` trait 来打印,因此它要求 `T` 必须受 "
+"`Display` 约束;换句话说,`T` **必须**实现 `Display`。"
#: src/generics/bounds.md:9
msgid ""
@@ -7973,7 +8210,8 @@
"the [methods](../fn/methods.md) of traits specified in the bounds. For "
"example:"
msgstr ""
-"约束的另一个作用是允许泛型实例访问约束中指定的 trait 的[方法](../fn/methods.md)。例如:"
+"约束的另一个作用是允许泛型实例访问约束中指定的 trait 的[方法](../fn/"
+"methods.md)。例如:"
#: src/generics/bounds.md:30
msgid "// A trait which implements the print marker: `{:?}`.\n"
@@ -8016,14 +8254,16 @@
"As an additional note, [`where`](../generics/where.md) clauses can also be "
"used to apply bounds in some cases to be more expressive."
msgstr ""
-"另外值得注意的是,在某些情况下可以使用 [`where`](../generics/where.md) 子句来应用约束,以使表达更加清晰。"
+"另外值得注意的是,在某些情况下可以使用 [`where`](../generics/where.md) 子句来"
+"应用约束,以使表达更加清晰。"
#: src/generics/bounds.md:75
msgid ""
-"[`std::fmt`](../hello/print.md), [`struct`s](../custom_types/structs.md), and "
-"[`trait`s](../trait.md)"
+"[`std::fmt`](../hello/print.md), [`struct`s](../custom_types/structs.md), "
+"and [`trait`s](../trait.md)"
msgstr ""
-"[`std::fmt`](../hello/print.md)、[`struct`](../custom_types/structs.md)和 [`trait`](../trait.md)"
+"[`std::fmt`](../hello/print.md)、[`struct`](../custom_types/structs.md)和 "
+"[`trait`](../trait.md)"
#: src/generics/bounds/testcase_empty.md:3
msgid ""
@@ -8031,7 +8271,8 @@
"any functionality, you can still use it as a bound. `Eq` and `Copy` are "
"examples of such `trait`s from the `std` library."
msgstr ""
-"约束的工作机制导致即使一个 `trait` 不包含任何功能,你仍然可以将其用作约束。`std` 库中的 `Eq` 和 `Copy` 就是这种 `trait` 的例子。"
+"约束的工作机制导致即使一个 `trait` 不包含任何功能,你仍然可以将其用作约束。"
+"`std` 库中的 `Eq` 和 `Copy` 就是这种 `trait` 的例子。"
#: src/generics/bounds/testcase_empty.md:17
msgid ""
@@ -8053,8 +8294,7 @@
msgid ""
"// `red()` won't work on a blue jay nor vice versa\n"
" // because of the bounds.\n"
-msgstr ""
-"// 由于约束的存在,`red()` 不能用于蓝松鸟,反之亦然。\n"
+msgstr "// 由于约束的存在,`red()` 不能用于蓝松鸟,反之亦然。\n"
#: src/generics/bounds/testcase_empty.md:30
msgid "\"A cardinal is {}\""
@@ -8074,18 +8314,19 @@
#: src/generics/bounds/testcase_empty.md:39
msgid ""
-"[`std::cmp::Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html), [`std::"
-"marker::Copy`](https://doc.rust-lang.org/std/marker/trait.Copy.html), and "
-"[`trait`s](../../trait.md)"
+"[`std::cmp::Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html), "
+"[`std::marker::Copy`](https://doc.rust-lang.org/std/marker/trait.Copy.html), "
+"and [`trait`s](../../trait.md)"
msgstr ""
-"[`std::cmp::Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html)、[`std::marker::Copy`](https://doc.rust-lang.org/std/marker/trait.Copy.html) 和 [`trait`](../../trait.md)"
+"[`std::cmp::Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html)、"
+"[`std::marker::Copy`](https://doc.rust-lang.org/std/marker/trait.Copy.html) "
+"和 [`trait`](../../trait.md)"
#: src/generics/multi_bounds.md:3
msgid ""
"Multiple bounds for a single type can be applied with a `+`. Like normal, "
"different types are separated with `,`."
-msgstr ""
-"可以使用 `+` 为单个类型指定多个约束。按照惯例,不同的类型用 `,` 分隔。"
+msgstr "可以使用 `+` 为单个类型指定多个约束。按照惯例,不同的类型用 `,` 分隔。"
#: src/generics/multi_bounds.md:10
msgid "\"Debug: `{:?}`\""
@@ -8126,7 +8367,8 @@
"clauses can apply bounds to arbitrary types, rather than just to type "
"parameters."
msgstr ""
-"约束也可以使用 `where` 子句来表达,它位于开括号 `{` 之前,而不是在类型首次提及时。此外,`where` 子句可以将约束应用于任意类型,而不仅限于类型参数。"
+"约束也可以使用 `where` 子句来表达,它位于开括号 `{` 之前,而不是在类型首次提"
+"及时。此外,`where` 子句可以将约束应用于任意类型,而不仅限于类型参数。"
#: src/generics/where.md:8
msgid "Some cases that a `where` clause is useful:"
@@ -8145,7 +8387,8 @@
"When using a `where` clause is more expressive than using normal syntax. The "
"`impl` in this example cannot be directly expressed without a `where` clause:"
msgstr ""
-"当使用 `where` 子句比使用普通语法更具表现力时。这个例子中的 `impl` 如果不使用 `where` 子句就无法直接表达:"
+"当使用 `where` 子句比使用普通语法更具表现力时。这个例子中的 `impl` 如果不使"
+"用 `where` 子句就无法直接表达:"
#: src/generics/where.md:30
msgid ""
@@ -8168,42 +8411,42 @@
"[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0135-where.md), "
"[`struct`](../custom_types/structs.md), and [`trait`](../trait.md)"
msgstr ""
-"[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0135-where.md)、[`struct`](../custom_types/structs.md) 和 [`trait`](../trait.md)"
+"[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0135-where.md)、"
+"[`struct`](../custom_types/structs.md) 和 [`trait`](../trait.md)"
#: src/generics/new_types.md:3
msgid ""
"The `newtype` idiom gives compile time guarantees that the right type of "
"value is supplied to a program."
-msgstr ""
-"`newtype` 模式在编译时保证了程序接收到正确类型的值。"
+msgstr "`newtype` 模式在编译时保证了程序接收到正确类型的值。"
#: src/generics/new_types.md:6
msgid ""
-"For example, an age verification function that checks age in years, _must_ be "
-"given a value of type `Years`."
+"For example, an age verification function that checks age in years, _must_ "
+"be given a value of type `Years`."
msgstr ""
-"例如,一个检查年龄(以年为单位)的年龄验证函数,**必须**接收 `Years` 类型的值。"
+"例如,一个检查年龄(以年为单位)的年龄验证函数,**必须**接收 `Years` 类型的"
+"值。"
-#: src/generics/new_types.md:22
+#: src/generics/new_types.md:21
msgid "/// truncates partial years\n"
msgstr "/// 截断不足一年的部分\n"
-#: src/generics/new_types.md:35 src/generics/new_types.md:36
+#: src/generics/new_types.md:34 src/generics/new_types.md:35
msgid "\"Is an adult? {}\""
msgstr "\"是否成年?{}\""
-#: src/generics/new_types.md:37
+#: src/generics/new_types.md:36
msgid "// println!(\"Is an adult? {}\", is_adult(&age_days));\n"
msgstr "// println!(\"是否成年?{}\", is_adult(&age_days));\n"
-#: src/generics/new_types.md:41
+#: src/generics/new_types.md:40
msgid ""
"Uncomment the last print statement to observe that the type supplied must be "
"`Years`."
-msgstr ""
-"取消最后一个 print 语句的注释,你会发现所提供的类型必须是 `Years`。"
+msgstr "取消最后一个 print 语句的注释,你会发现所提供的类型必须是 `Years`。"
-#: src/generics/new_types.md:43
+#: src/generics/new_types.md:42
msgid ""
"To obtain the `newtype`'s value as the base type, you may use the tuple or "
"destructuring syntax like so:"
@@ -8225,31 +8468,37 @@
#: src/generics/assoc_items.md:3
msgid ""
"\"Associated Items\" refers to a set of rules pertaining to [`item`](https://"
-"doc.rust-lang.org/reference/items.html)s of various types. It is an extension "
-"to `trait` generics, and allows `trait`s to internally define new items."
+"doc.rust-lang.org/reference/items.html)s of various types. It is an "
+"extension to `trait` generics, and allows `trait`s to internally define new "
+"items."
msgstr ""
-""关联项"是指与各种类型的[`项`](https://doc.rust-lang.org/reference/items.html)相关的一组规则。它是 `trait` 泛型的扩展,允许 `trait` 在内部定义新的项。"
+"\"关联项\"是指与各种类型的[`项`](https://doc.rust-lang.org/reference/"
+"items.html)相关的一组规则。它是 `trait` 泛型的扩展,允许 `trait` 在内部定义新"
+"的项。"
#: src/generics/assoc_items.md:7
msgid ""
"One such item is called an _associated type_, providing simpler usage "
"patterns when the `trait` is generic over its container type."
msgstr ""
-"其中一种项被称为**关联类型**,当 `trait` 对其容器类型是泛型时,它提供了更简洁的使用模式。"
+"其中一种项被称为**关联类型**,当 `trait` 对其容器类型是泛型时,它提供了更简洁"
+"的使用模式。"
#: src/generics/assoc_items.md:12
msgid ""
"[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-"
"items.md)"
msgstr ""
-"[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-items.md)"
+"[RFC](https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-"
+"items.md)"
#: src/generics/assoc_items/the_problem.md:3
msgid ""
"A `trait` that is generic over its container type has type specification "
"requirements - users of the `trait` _must_ specify all of its generic types."
msgstr ""
-"对于容器类型是泛型的 `trait`,有类型规范要求 —— `trait` 的使用者**必须**指定所有的泛型类型。"
+"对于容器类型是泛型的 `trait`,有类型规范要求 —— `trait` 的使用者**必须**指定"
+"所有的泛型类型。"
#: src/generics/assoc_items/the_problem.md:6
msgid ""
@@ -8258,16 +8507,20 @@
"specifying `i32` for `A` and `B` so that it can be used with `fn "
"difference()`."
msgstr ""
-"在下面的例子中,`Contains` trait 允许使用泛型类型 `A` 和 `B`。然后为 `Container` 类型实现该 trait,将 `A` 和 `B` 指定为 `i32`,以便与 `fn difference()` 一起使用。"
+"在下面的例子中,`Contains` trait 允许使用泛型类型 `A` 和 `B`。然后为 "
+"`Container` 类型实现该 trait,将 `A` 和 `B` 指定为 `i32`,以便与 `fn "
+"difference()` 一起使用。"
#: src/generics/assoc_items/the_problem.md:10
msgid ""
-"Because `Contains` is generic, we are forced to explicitly state _all_ of the "
-"generic types for `fn difference()`. In practice, we want a way to express "
-"that `A` and `B` are determined by the _input_ `C`. As you will see in the "
-"next section, associated types provide exactly that capability."
+"Because `Contains` is generic, we are forced to explicitly state _all_ of "
+"the generic types for `fn difference()`. In practice, we want a way to "
+"express that `A` and `B` are determined by the _input_ `C`. As you will see "
+"in the next section, associated types provide exactly that capability."
msgstr ""
-"由于 `Contains` 是泛型的,我们不得不为 `fn difference()` 显式声明**所有**泛型类型。实际上,我们希望有一种方法来表达 `A` 和 `B` 是由**输入** `C` 决定的。正如你将在下一节中看到的,关联类型恰好提供了这种能力。"
+"由于 `Contains` 是泛型的,我们不得不为 `fn difference()` 显式声明**所有**泛型"
+"类型。实际上,我们希望有一种方法来表达 `A` 和 `B` 是由**输入** `C` 决定的。正"
+"如你将在下一节中看到的,关联类型恰好提供了这种能力。"
#: src/generics/assoc_items/the_problem.md:17
#: src/generics/assoc_items/types.md:36
@@ -8332,8 +8585,7 @@
#: src/generics/assoc_items/the_problem.md:64
msgid ""
"[`struct`s](../../custom_types/structs.md), and [`trait`s](../../trait.md)"
-msgstr ""
-"[`struct`](../../custom_types/structs.md) 和 [`trait`](../../trait.md)"
+msgstr "[`struct`](../../custom_types/structs.md) 和 [`trait`](../../trait.md)"
#: src/generics/assoc_items/types.md:3
msgid ""
@@ -8341,8 +8593,8 @@
"moving inner types locally into a trait as _output_ types. Syntax for the "
"`trait` definition is as follows:"
msgstr ""
-"使用"关联类型"通过将内部类型局部移动到 trait 中作为**输出**类型,提高了代码的整体可读性。"
-"trait 定义的语法如下:"
+"使用\"关联类型\"通过将内部类型局部移动到 trait 中作为**输出**类型,提高了代码"
+"的整体可读性。trait 定义的语法如下:"
#: src/generics/assoc_items/types.md:8
msgid ""
@@ -8359,10 +8611,9 @@
#: src/generics/assoc_items/types.md:20
msgid ""
-"Note that functions that use the `trait` `Contains` are no longer required to "
-"express `A` or `B` at all:"
-msgstr ""
-"注意,使用 `Contains` trait 的函数不再需要显式指定 `A` 或 `B`:"
+"Note that functions that use the `trait` `Contains` are no longer required "
+"to express `A` or `B` at all:"
+msgstr "注意,使用 `Contains` trait 的函数不再需要显式指定 `A` 或 `B`:"
#: src/generics/assoc_items/types.md:24
msgid "// Without using associated types\n"
@@ -8399,31 +8650,32 @@
msgid ""
"A phantom type parameter is one that doesn't show up at runtime, but is "
"checked statically (and only) at compile time."
-msgstr ""
-"虚类型参数是一种在运行时不会出现,但在编译时会进行静态检查的类型参数。"
+msgstr "虚类型参数是一种在运行时不会出现,但在编译时会进行静态检查的类型参数。"
#: src/generics/phantom.md:6
msgid ""
"Data types can use extra generic type parameters to act as markers or to "
-"perform type checking at compile time. These extra parameters hold no storage "
-"values, and have no runtime behavior."
+"perform type checking at compile time. These extra parameters hold no "
+"storage values, and have no runtime behavior."
msgstr ""
-"数据类型可以使用额外的泛型类型参数作为标记,或在编译时进行类型检查。这些额外的参数不占用存储空间,也没有运行时行为。"
+"数据类型可以使用额外的泛型类型参数作为标记,或在编译时进行类型检查。这些额外"
+"的参数不占用存储空间,也没有运行时行为。"
#: src/generics/phantom.md:10
msgid ""
-"In the following example, we combine [std::marker::PhantomData](https://doc."
-"rust-lang.org/std/marker/struct.PhantomData.html) with the phantom type "
+"In the following example, we combine [std::marker::PhantomData](https://"
+"doc.rust-lang.org/std/marker/struct.PhantomData.html) with the phantom type "
"parameter concept to create tuples containing different data types."
msgstr ""
-"在下面的示例中,我们将 [`std::marker::PhantomData`](https://doc.rust-lang.org/std/marker/struct.PhantomData.html) 与虚类型参数的概念结合,创建包含不同数据类型的元组。"
+"在下面的示例中,我们将 [`std::marker::PhantomData`](https://doc.rust-"
+"lang.org/std/marker/struct.PhantomData.html) 与虚类型参数的概念结合,创建包含"
+"不同数据类型的元组。"
#: src/generics/phantom.md:16
msgid ""
"// A phantom tuple struct which is generic over `A` with hidden parameter "
"`B`.\n"
-msgstr ""
-"// 一个虚元组结构体,它在 `A` 上是泛型的,带有隐藏参数 `B`。\n"
+msgstr "// 一个虚元组结构体,它在 `A` 上是泛型的,带有隐藏参数 `B`。\n"
#: src/generics/phantom.md:18 src/generics/phantom.md:22
msgid "// Allow equality test for this type.\n"
@@ -8433,8 +8685,7 @@
msgid ""
"// A phantom type struct which is generic over `A` with hidden parameter "
"`B`.\n"
-msgstr ""
-"// 一个虚类型结构体,它在 `A` 上是泛型的,带有隐藏参数 `B`。\n"
+msgstr "// 一个虚类型结构体,它在 `A` 上是泛型的,带有隐藏参数 `B`。\n"
#: src/generics/phantom.md:24
msgid ""
@@ -8495,14 +8746,16 @@
"[Derive](../trait/derive.md), [struct](../custom_types/structs.md), and "
"[TupleStructs](../custom_types/structs.md)"
msgstr ""
-"[派生(Derive)](../trait/derive.md)、[结构体(struct)](../custom_types/structs.md)和[元组结构体(TupleStructs)](../custom_types/structs.md)"
+"[派生(Derive)](../trait/derive.md)、[结构体(struct)](../custom_types/"
+"structs.md)和[元组结构体(TupleStructs)](../custom_types/structs.md)"
#: src/generics/phantom/testcase_units.md:3
msgid ""
"A useful method of unit conversions can be examined by implementing `Add` "
"with a phantom type parameter. The `Add` `trait` is examined below:"
msgstr ""
-"通过使用虚类型参数实现 `Add` trait,我们可以探索一种有用的单位转换方法。下面我们来看看 `Add` trait:"
+"通过使用虚类型参数实现 `Add` trait,我们可以探索一种有用的单位转换方法。下面"
+"我们来看看 `Add` trait:"
#: src/generics/phantom/testcase_units.md:7
msgid ""
@@ -8594,11 +8847,15 @@
msgid ""
"[Borrowing (`&`)](../../scope/borrow.md), [Bounds (`X: Y`)](../../generics/"
"bounds.md), [enum](../../custom_types/enum.md), [impl & self](../../fn/"
-"methods.md), [Overloading](../../trait/ops.md), [ref](../../scope/borrow/ref."
-"md), [Traits (`X for Y`)](../../trait.md), and [TupleStructs](../../"
+"methods.md), [Overloading](../../trait/ops.md), [ref](../../scope/borrow/"
+"ref.md), [Traits (`X for Y`)](../../trait.md), and [TupleStructs](../../"
"custom_types/structs.md)."
msgstr ""
-"[借用(`&`)](../../scope/borrow.md)、[约束(`X: Y`)](../../generics/bounds.md)、[枚举](../../custom_types/enum.md)、[impl 和 self](../../fn/methods.md)、[运算符重载](../../trait/ops.md)、[ref](../../scope/borrow/ref.md)、[trait(`X for Y`)](../../trait.md)以及[元组结构体](../../custom_types/structs.md)。"
+"[借用(`&`)](../../scope/borrow.md)、[约束(`X: Y`)](../../generics/"
+"bounds.md)、[枚举](../../custom_types/enum.md)、[impl 和 self](../../fn/"
+"methods.md)、[运算符重载](../../trait/ops.md)、[ref](../../scope/borrow/"
+"ref.md)、[trait(`X for Y`)](../../trait.md)以及[元组结构体](../../"
+"custom_types/structs.md)。"
#: src/scope.md:3
msgid ""
@@ -8606,7 +8863,8 @@
"is, they indicate to the compiler when borrows are valid, when resources can "
"be freed, and when variables are created or destroyed."
msgstr ""
-"作用域在所有权、借用和生命周期中扮演着重要角色。它们向编译器指示借用何时有效、资源何时可以被释放,以及变量何时被创建或销毁。"
+"作用域在所有权、借用和生命周期中扮演着重要角色。它们向编译器指示借用何时有"
+"效、资源何时可以被释放,以及变量何时被创建或销毁。"
#: src/scope/raii.md:3
msgid ""
@@ -8616,9 +8874,10 @@
"(Resource Acquisition Is Initialization), so whenever an object goes out of "
"scope, its destructor is called and its owned resources are freed."
msgstr ""
-"Rust 中的变量不仅仅是在栈上保存数据:它们还**拥有**资源,例如 `Box<T>` 拥有堆上的内存。Rust 强制执行 [RAII]"
-"(https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization)(资源获取即初始化),因此每当一个对象离开作用域时,"
-"它的析构函数就会被调用,它拥有的资源也会被释放。"
+"Rust 中的变量不仅仅是在栈上保存数据:它们还**拥有**资源,例如 `Box<T>` 拥有堆"
+"上的内存。Rust 强制执行 [RAII](https://en.wikipedia.org/wiki/"
+"Resource_Acquisition_Is_Initialization)(资源获取即初始化),因此每当一个对象"
+"离开作用域时,它的析构函数就会被调用,它拥有的资源也会被释放。"
#: src/scope/raii.md:8
msgid ""
@@ -8626,7 +8885,8 @@
"manually free memory or worry about memory leaks again! Here's a quick "
"showcase:"
msgstr ""
-"这种行为可以防止**资源泄漏**错误,因此你再也不用手动释放内存或担心内存泄漏了!以下是一个简单示例:"
+"这种行为可以防止**资源泄漏**错误,因此你再也不用手动释放内存或担心内存泄漏"
+"了!以下是一个简单示例:"
#: src/scope/raii.md:12
msgid "// raii.rs\n"
@@ -8665,7 +8925,8 @@
"Of course, we can double check for memory errors using [`valgrind`](http://"
"valgrind.org/info/):"
msgstr ""
-"当然,我们可以使用 [`valgrind`](http://valgrind.org/info/) 来再次检查内存错误:"
+"当然,我们可以使用 [`valgrind`](http://valgrind.org/info/) 来再次检查内存错"
+"误:"
#: src/scope/raii.md:65
msgid "No leaks here!"
@@ -8683,8 +8944,10 @@
"implemented for every type, only implement it for your type if you require "
"its own destructor logic."
msgstr ""
-"Rust 中的析构函数概念是通过 [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) trait 提供的。"
-"当资源离开作用域时,析构函数会被调用。并非每种类型都需要实现这个 trait,只有当你需要为自己的类型实现特定的析构逻辑时才需要实现它。"
+"Rust 中的析构函数概念是通过 [`Drop`](https://doc.rust-lang.org/std/ops/"
+"trait.Drop.html) trait 提供的。当资源离开作用域时,析构函数会被调用。并非每种"
+"类型都需要实现这个 trait,只有当你需要为自己的类型实现特定的析构逻辑时才需要"
+"实现它。"
#: src/scope/raii.md:74
msgid ""
@@ -8692,8 +8955,9 @@
"ops/trait.Drop.html) trait works. When the variable in the `main` function "
"goes out of scope the custom destructor will be invoked."
msgstr ""
-"运行下面的示例来了解 [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) trait 是如何工作的。"
-"当 `main` 函数中的变量离开作用域时,自定义的析构函数将被调用。"
+"运行下面的示例来了解 [`Drop`](https://doc.rust-lang.org/std/ops/"
+"trait.Drop.html) trait 是如何工作的。当 `main` 函数中的变量离开作用域时,自定"
+"义的析构函数将被调用。"
#: src/scope/raii.md:82
msgid "\"ToDrop is being dropped\""
@@ -8710,12 +8974,13 @@
#: src/scope/move.md:3
msgid ""
"Because variables are in charge of freeing their own resources, **resources "
-"can only have one owner**. This prevents resources from being freed more than "
-"once. Note that not all variables own resources (e.g. [references](../"
+"can only have one owner**. This prevents resources from being freed more "
+"than once. Note that not all variables own resources (e.g. [references](../"
"flow_control/match/destructuring/destructure_pointers.md))."
msgstr ""
-"由于变量负责释放它们自己的资源,**资源只能有一个所有者**。这可以防止资源被多次释放。"
-"请注意,并非所有变量都拥有资源(例如[引用](../flow_control/match/destructuring/destructure_pointers.md))。"
+"由于变量负责释放它们自己的资源,**资源只能有一个所有者**。这可以防止资源被多"
+"次释放。请注意,并非所有变量都拥有资源(例如[引用](../flow_control/match/"
+"destructuring/destructure_pointers.md))。"
#: src/scope/move.md:8
msgid ""
@@ -8723,19 +8988,18 @@
"(`foo(x)`), the _ownership_ of the resources is transferred. In Rust-speak, "
"this is known as a _move_."
msgstr ""
-"当进行赋值(`let x = y`)或按值传递函数参数(`foo(x)`)时,资源的**所有权**会被转移。在 Rust 中,这被称为**移动**(move)。"
+"当进行赋值(`let x = y`)或按值传递函数参数(`foo(x)`)时,资源的**所有权**会"
+"被转移。在 Rust 中,这被称为**移动**(move)。"
#: src/scope/move.md:12
msgid ""
-"After moving resources, the previous owner can no longer be used. This avoids "
-"creating dangling pointers."
-msgstr ""
-"资源移动后,原所有者将无法再被使用。这避免了悬垂指针的产生。"
+"After moving resources, the previous owner can no longer be used. This "
+"avoids creating dangling pointers."
+msgstr "资源移动后,原所有者将无法再被使用。这避免了悬垂指针的产生。"
#: src/scope/move.md:16
msgid "// This function takes ownership of the heap allocated memory\n"
-msgstr ""
-"// 此函数获取堆分配内存的所有权\n"
+msgstr "// 此函数获取堆分配内存的所有权\n"
#: src/scope/move.md:18
msgid "\"Destroying a box that contains {}\""
@@ -8743,23 +9007,19 @@
#: src/scope/move.md:20
msgid "// `c` is destroyed and the memory freed\n"
-msgstr ""
-"// `c` 被销毁,内存被释放\n"
+msgstr "// `c` 被销毁,内存被释放\n"
#: src/scope/move.md:24
msgid "// _Stack_ allocated integer\n"
-msgstr ""
-"// **栈**分配的整数\n"
+msgstr "// **栈**分配的整数\n"
#: src/scope/move.md:27
msgid "// *Copy* `x` into `y` - no resources are moved\n"
-msgstr ""
-"// 将 `x` **复制**到 `y` - 没有资源被移动\n"
+msgstr "// 将 `x` **复制**到 `y` - 没有资源被移动\n"
#: src/scope/move.md:30
msgid "// Both values can be independently used\n"
-msgstr ""
-"// 两个值可以独立使用\n"
+msgstr "// 两个值可以独立使用\n"
#: src/scope/move.md:31
msgid "\"x is {}, and y is {}\""
@@ -8767,8 +9027,7 @@
#: src/scope/move.md:33
msgid "// `a` is a pointer to a _heap_ allocated integer\n"
-msgstr ""
-"// `a` 是指向**堆**分配整数的指针\n"
+msgstr "// `a` 是指向**堆**分配整数的指针\n"
#: src/scope/move.md:36
msgid "\"a contains: {}\""
@@ -8776,8 +9035,7 @@
#: src/scope/move.md:38
msgid "// *Move* `a` into `b`\n"
-msgstr ""
-"// 将 `a` **移动**到 `b`\n"
+msgstr "// 将 `a` **移动**到 `b`\n"
#: src/scope/move.md:40
msgid ""
@@ -8801,9 +9059,9 @@
" // TODO ^ 尝试取消此行注释\n"
#: src/scope/move.md:49
-msgid "// This function takes ownership of the heap allocated memory from `b`\n"
-msgstr ""
-"// 此函数从 `b` 获取堆分配内存的所有权\n"
+msgid ""
+"// This function takes ownership of the heap allocated memory from `b`\n"
+msgstr "// 此函数从 `b` 获取堆分配内存的所有权\n"
#: src/scope/move.md:52
msgid ""
@@ -8859,24 +9117,49 @@
"used at the same time. Doing this will result in a _partial move_ of the "
"variable, which means that parts of the variable will be moved while other "
"parts stay. In such a case, the parent variable cannot be used afterwards as "
-"a whole, however the parts that are only referenced (and not moved) can still "
-"be used."
+"a whole, however the parts that are only referenced (and not moved) can "
+"still be used. Note that types that implement the [`Drop` trait](../../trait/"
+"drop.md) cannot be partially moved from, because its `drop` method would use "
+"it afterwards as a whole."
msgstr ""
-"在对单个变量进行[解构](../../flow_control/match/destructuring.md)时,可以同时使用 `by-move` 和 `by-reference` 模式绑定。这样做会导致变量的**部分移动**,这意味着变量的一部分会被移动,而其他部分保持不变。在这种情况下,父级变量之后不能作为一个整体使用,但是仍然可以使用只被引用(而不是被移动)的部分。"
+"在对单个变量进行[解构](../../flow_control/match/destructuring.md)时,可以同时"
+"使用 `by-move` 和 `by-reference` 模式绑定。这样做会导致变量的**部分移动**,这"
+"意味着变量的一部分会被移动,而其他部分保持不变。在这种情况下,父级变量之后不"
+"能作为一个整体使用,但是仍然可以使用只被引用(而不是被移动)的部分。注意,实"
+"现了 [`Drop` 特质](../../trait/drop.md) 的类型不能被部分移动,因为其 `drop` "
+"方法会在之后将其作为整体使用。"
-#: src/scope/move/partial_move.md:24
+#: src/scope/move/partial_move.md:22
+msgid ""
+"// Error! cannot move out of a type which implements the `Drop` trait\n"
+" //impl Drop for Person {\n"
+" // fn drop(&mut self) {\n"
+" // println!(\"Dropping the person struct {:?}\", self)\n"
+" // }\n"
+" //}\n"
+" // TODO ^ Try uncommenting these lines\n"
+msgstr ""
+"// 错误!无法从实现了 `Drop` 特质的类型中移动\n"
+" //impl Drop for Person {\n"
+" // fn drop(&mut self) {\n"
+" // println!(\"Dropping the person struct {:?}\", self)\n"
+" // }\n"
+" //}\n"
+" // TODO ^ 尝试取消注释这些行\n"
+
+#: src/scope/move/partial_move.md:35
msgid "// `name` is moved out of person, but `age` is referenced\n"
msgstr "// `name` 从 person 中被移出,但 `age` 只是被引用\n"
-#: src/scope/move/partial_move.md:27
+#: src/scope/move/partial_move.md:38
msgid "\"The person's age is {}\""
msgstr "\"此人的年龄是 {}\""
-#: src/scope/move/partial_move.md:29
+#: src/scope/move/partial_move.md:40
msgid "\"The person's name is {}\""
msgstr "\"此人的姓名是 {}\""
-#: src/scope/move/partial_move.md:31
+#: src/scope/move/partial_move.md:42
msgid ""
"// Error! borrow of partially moved value: `person` partial move occurs\n"
" //println!(\"The person struct is {:?}\", person);\n"
@@ -8884,27 +9167,29 @@
"// 错误!借用部分移动的值:`person` 发生部分移动\n"
" //println!(\"person 结构体是 {:?}\", person);\n"
-#: src/scope/move/partial_move.md:34
+#: src/scope/move/partial_move.md:45
msgid ""
"// `person` cannot be used but `person.age` can be used as it is not moved\n"
-msgstr ""
-"// `person` 不能使用,但 `person.age` 可以使用,因为它没有被移动\n"
+msgstr "// `person` 不能使用,但 `person.age` 可以使用,因为它没有被移动\n"
-#: src/scope/move/partial_move.md:35
+#: src/scope/move/partial_move.md:46
msgid "\"The person's age from person struct is {}\""
msgstr "\"从 person 结构体中获取的年龄是 {}\""
-#: src/scope/move/partial_move.md:38
+#: src/scope/move/partial_move.md:50
msgid ""
"(In this example, we store the `age` variable on the heap to illustrate the "
"partial move: deleting `ref` in the above code would give an error as the "
-"ownership of `person.age` would be moved to the variable `age`. If `Person."
-"age` were stored on the stack, `ref` would not be required as the definition "
-"of `age` would copy the data from `person.age` without moving it.)"
+"ownership of `person.age` would be moved to the variable `age`. If "
+"`Person.age` were stored on the stack, `ref` would not be required as the "
+"definition of `age` would copy the data from `person.age` without moving it.)"
msgstr ""
-"(在这个例子中,我们将 `age` 变量存储在堆上以说明部分移动:删除上面代码中的 `ref` 会导致错误,因为 `person.age` 的所有权会被移动到变量 `age`。如果 `Person.age` 存储在栈上,就不需要 `ref`,因为 `age` 的定义会从 `person.age` 复制数据而不是移动它。)"
+"(在这个例子中,我们将 `age` 变量存储在堆上以说明部分移动:删除上面代码中的 "
+"`ref` 会导致错误,因为 `person.age` 的所有权会被移动到变量 `age`。如果 "
+"`Person.age` 存储在栈上,就不需要 `ref`,因为 `age` 的定义会从 `person.age` "
+"复制数据而不是移动它。)"
-#: src/scope/move/partial_move.md:46
+#: src/scope/move/partial_move.md:59
msgid "[destructuring](../../flow_control/match/destructuring.md)"
msgstr "[解构](../../flow_control/match/destructuring.md)"
@@ -8914,7 +9199,8 @@
"To accomplish this, Rust uses a _borrowing_ mechanism. Instead of passing "
"objects by value (`T`), objects can be passed by reference (`&T`)."
msgstr ""
-"大多数情况下,我们希望访问数据而不获取其所有权。为了实现这一点,Rust 使用了**借用**机制。对象可以通过引用(`&T`)传递,而不是按值(`T`)传递。"
+"大多数情况下,我们希望访问数据而不获取其所有权。为了实现这一点,Rust 使用了**"
+"借用**机制。对象可以通过引用(`&T`)传递,而不是按值(`T`)传递。"
#: src/scope/borrow.md:7
msgid ""
@@ -8922,7 +9208,8 @@
"_always_ point to valid objects. That is, while references to an object "
"exist, the object cannot be destroyed."
msgstr ""
-"编译器通过其借用检查器静态地保证引用**始终**指向有效的对象。也就是说,当存在指向一个对象的引用时,该对象就不能被销毁。"
+"编译器通过其借用检查器静态地保证引用**始终**指向有效的对象。也就是说,当存在"
+"指向一个对象的引用时,该对象就不能被销毁。"
#: src/scope/borrow.md:12
msgid "// This function takes ownership of a box and destroys it\n"
@@ -8983,23 +9270,23 @@
#: src/scope/borrow.md:48
msgid ""
"// `boxed_i32` can now give up ownership to `eat_box_i32` and be destroyed\n"
-msgstr ""
-"// `boxed_i32` 现在可以将所有权交给 `eat_box_i32` 并被销毁\n"
+msgstr "// `boxed_i32` 现在可以将所有权交给 `eat_box_i32` 并被销毁\n"
#: src/scope/borrow/mut.md:3
msgid ""
"Mutable data can be mutably borrowed using `&mut T`. This is called a "
-"_mutable reference_ and gives read/write access to the borrower. In contrast, "
-"`&T` borrows the data via an immutable reference, and the borrower can read "
-"the data but not modify it:"
+"_mutable reference_ and gives read/write access to the borrower. In "
+"contrast, `&T` borrows the data via an immutable reference, and the borrower "
+"can read the data but not modify it:"
msgstr ""
-"可变数据可以使用 `&mut T` 进行可变借用。这被称为**可变引用**,并给予借用者读写访问权。相比之下,`&T` 通过不可变引用借用数据,借用者可以读取数据但不能修改它:"
+"可变数据可以使用 `&mut T` 进行可变借用。这被称为**可变引用**,并给予借用者读"
+"写访问权。相比之下,`&T` 通过不可变引用借用数据,借用者可以读取数据但不能修改"
+"它:"
#: src/scope/borrow/mut.md:12
msgid ""
"// `&'static str` is a reference to a string allocated in read only memory\n"
-msgstr ""
-"// `&'static str` 是对分配在只读内存中的字符串的引用\n"
+msgstr "// `&'static str` 是对分配在只读内存中的字符串的引用\n"
#: src/scope/borrow/mut.md:17
msgid "// This function takes a reference to a book\n"
@@ -9013,8 +9300,7 @@
msgid ""
"// This function takes a reference to a mutable book and changes `year` to "
"2014\n"
-msgstr ""
-"// 此函数接受一个对可变 Book 的引用,并将 `year` 改为 2014\n"
+msgstr "// 此函数接受一个对可变 Book 的引用,并将 `year` 改为 2014\n"
#: src/scope/borrow/mut.md:26
msgid "\"I mutably borrowed {} - {} edition\""
@@ -9056,7 +9342,7 @@
msgid "// Error! Cannot borrow an immutable object as mutable\n"
msgstr "// 错误!不能将不可变对象作为可变对象借用\n"
-#: src/scope/borrow/mut.md:57
+#: src/scope/borrow/mut.md:58
msgid "[`static`](../lifetime/static_lifetime.md)"
msgstr "[`static`](../lifetime/static_lifetime.md)"
@@ -9068,7 +9354,9 @@
"borrowed again only _after_ the mutable reference has been used for the last "
"time."
msgstr ""
-"数据可以被不可变借用任意次数,但在不可变借用期间,原始数据不能被可变借用。另一方面,同一时间只允许**一个**可变借用。只有在可变引用最后一次使用之后,原始数据才能再次被借用。"
+"数据可以被不可变借用任意次数,但在不可变借用期间,原始数据不能被可变借用。另"
+"一方面,同一时间只允许**一个**可变借用。只有在可变引用最后一次使用之后,原始"
+"数据才能再次被借用。"
#: src/scope/borrow/alias.md:17
msgid "// Data can be accessed via the references and the original owner\n"
@@ -9135,8 +9423,7 @@
msgid ""
"// The mutable reference is no longer used for the rest of the code so it\n"
" // is possible to reborrow\n"
-msgstr ""
-"// 可变引用在代码的剩余部分不再使用,所以可以重新借用\n"
+msgstr "// 可变引用在代码的剩余部分不再使用,所以可以重新借用\n"
#: src/scope/borrow/alias.md:55
msgid "\"Point now has coordinates: ({}, {}, {})\""
@@ -9144,18 +9431,18 @@
#: src/scope/borrow/ref.md:3
msgid ""
-"When doing pattern matching or destructuring via the `let` binding, the `ref` "
-"keyword can be used to take references to the fields of a struct/tuple. The "
-"example below shows a few instances where this can be useful:"
+"When doing pattern matching or destructuring via the `let` binding, the "
+"`ref` keyword can be used to take references to the fields of a struct/"
+"tuple. The example below shows a few instances where this can be useful:"
msgstr ""
-"在使用 `let` 绑定进行模式匹配或解构时,可以使用 `ref` 关键字来获取结构体或元组字段的引用。以下示例展示了几个这种用法有用的场景:"
+"在使用 `let` 绑定进行模式匹配或解构时,可以使用 `ref` 关键字来获取结构体或元"
+"组字段的引用。以下示例展示了几个这种用法有用的场景:"
#: src/scope/borrow/ref.md:14
msgid ""
"// A `ref` borrow on the left side of an assignment is equivalent to\n"
" // an `&` borrow on the right side.\n"
-msgstr ""
-"// 赋值左侧的 `ref` 借用等同于右侧的 `&` 借用。\n"
+msgstr "// 赋值左侧的 `ref` 借用等同于右侧的 `&` 借用。\n"
#: src/scope/borrow/ref.md:19
msgid "\"ref_c1 equals ref_c2: {}\""
@@ -9212,7 +9499,9 @@
"lifetime begins when it is created and ends when it is destroyed. While "
"lifetimes and scopes are often referred to together, they are not the same."
msgstr ""
-"**生命周期**是编译器(更具体地说是其**借用检查器**)用来确保所有借用都有效的一种机制。具体来说,变量的生命周期从创建时开始,到销毁时结束。尽管生命周期和作用域经常被一同提及,但它们并不完全相同。"
+"**生命周期**是编译器(更具体地说是其**借用检查器**)用来确保所有借用都有效的"
+"一种机制。具体来说,变量的生命周期从创建时开始,到销毁时结束。尽管生命周期和"
+"作用域经常被一同提及,但它们并不完全相同。"
#: src/scope/lifetime.md:8
msgid ""
@@ -9221,14 +9510,17 @@
"borrow is valid as long as it ends before the lender is destroyed. However, "
"the scope of the borrow is determined by where the reference is used."
msgstr ""
-"举个例子,当我们通过 `&` 借用一个变量时,这个借用的生命周期由其声明位置决定。因此,只要借用在出借者被销毁之前结束,它就是有效的。然而,借用的作用域则由引用使用的位置决定。"
+"举个例子,当我们通过 `&` 借用一个变量时,这个借用的生命周期由其声明位置决定。"
+"因此,只要借用在出借者被销毁之前结束,它就是有效的。然而,借用的作用域则由引"
+"用使用的位置决定。"
#: src/scope/lifetime.md:13
msgid ""
"In the following example and in the rest of this section, we will see how "
"lifetimes relate to scopes, as well as how the two differ."
msgstr ""
-"在接下来的例子和本节的其余部分中,我们将看到生命周期如何与作用域相关联,以及两者之间的区别。"
+"在接下来的例子和本节的其余部分中,我们将看到生命周期如何与作用域相关联,以及"
+"两者之间的区别。"
#: src/scope/lifetime.md:17
msgid ""
@@ -9310,17 +9602,20 @@
"Note that no names or types are assigned to label lifetimes. This restricts "
"how lifetimes will be able to be used as we will see."
msgstr ""
-"请注意,生命周期标签没有被赋予名称或类型。这限制了生命周期的使用方式,我们将在后面看到这一点。"
+"请注意,生命周期标签没有被赋予名称或类型。这限制了生命周期的使用方式,我们将"
+"在后面看到这一点。"
#: src/scope/lifetime/explicit.md:3
msgid ""
"The borrow checker uses explicit lifetime annotations to determine how long "
-"references should be valid. In cases where lifetimes are not elided[^1], Rust "
-"requires explicit annotations to determine what the lifetime of a reference "
-"should be. The syntax for explicitly annotating a lifetime uses an apostrophe "
-"character as follows:"
+"references should be valid. In cases where lifetimes are not elided[^1], "
+"Rust requires explicit annotations to determine what the lifetime of a "
+"reference should be. The syntax for explicitly annotating a lifetime uses an "
+"apostrophe character as follows:"
msgstr ""
-"借用检查器使用显式生命周期注解来确定引用应该有效多长时间。在生命周期没有被省略[^1]的情况下,Rust 需要显式注解来确定引用的生命周期。显式注解生命周期的语法使用撇号字符,如下所示:"
+"借用检查器使用显式生命周期注解来确定引用应该有效多长时间。在生命周期没有被省"
+"略[^1]的情况下,Rust 需要显式注解来确定引用的生命周期。显式注解生命周期的语法"
+"使用撇号字符,如下所示:"
#: src/scope/lifetime/explicit.md:10
msgid "// `foo` has a lifetime parameter `'a`\n"
@@ -9333,7 +9628,9 @@
"lifetime of `foo` may not exceed that of `'a`. Explicit annotation of a type "
"has the form `&'a T` where `'a` has already been introduced."
msgstr ""
-"类似于[闭包](../../fn/closures/anonymity.md),使用生命周期需要泛型。此外,这种生命周期语法表示 `foo` 的生命周期不能超过 `'a` 的生命周期。类型的显式注解形式为 `&'a T`,其中 `'a` 已经被引入。"
+"类似于[闭包](../../fn/closures/anonymity.md),使用生命周期需要泛型。此外,这"
+"种生命周期语法表示 `foo` 的生命周期不能超过 `'a` 的生命周期。类型的显式注解形"
+"式为 `&'a T`,其中 `'a` 已经被引入。"
#: src/scope/lifetime/explicit.md:19
msgid "In cases with multiple lifetimes, the syntax is similar:"
@@ -9370,13 +9667,11 @@
#: src/scope/lifetime/explicit.md:37
msgid ""
"// A function which takes no arguments, but has a lifetime parameter `'a`.\n"
-msgstr ""
-"// 一个没有参数但有生命周期参数 `'a` 的函数。\n"
+msgstr "// 一个没有参数但有生命周期参数 `'a` 的函数。\n"
#: src/scope/lifetime/explicit.md:42
msgid "// ERROR: `_x` does not live long enough\n"
-msgstr ""
-"// 错误:`_x` 的生命周期不够长\n"
+msgstr "// 错误:`_x` 的生命周期不够长\n"
#: src/scope/lifetime/explicit.md:44
msgid ""
@@ -9392,13 +9687,11 @@
#: src/scope/lifetime/explicit.md:50
msgid "// Create variables to be borrowed below.\n"
-msgstr ""
-"// 创建将要被借用的变量。\n"
+msgstr "// 创建将要被借用的变量。\n"
#: src/scope/lifetime/explicit.md:53
msgid "// Borrows (`&`) of both variables are passed into the function.\n"
-msgstr ""
-"// 将两个变量的借用(`&`)传递给函数。\n"
+msgstr "// 将两个变量的借用(`&`)传递给函数。\n"
#: src/scope/lifetime/explicit.md:55
msgid ""
@@ -9423,32 +9716,31 @@
#: src/scope/lifetime/explicit.md:66
msgid ""
"[elision](elision.md) implicitly annotates lifetimes and so is different."
-msgstr ""
-"[省略(elision)](elision.md)隐式地注解生命周期,因此与显式注解不同。"
+msgstr "[省略(elision)](elision.md)隐式地注解生命周期,因此与显式注解不同。"
#: src/scope/lifetime/explicit.md:70
msgid "[generics](../../generics.md) and [closures](../../fn/closures.md)"
msgstr ""
-"[泛型(generics)](../../generics.md)和[闭包(closures)](../../fn/closures.md)"
+"[泛型(generics)](../../generics.md)和[闭包(closures)](../../fn/"
+"closures.md)"
#: src/scope/lifetime/fn.md:3
msgid ""
-"Ignoring [elision](elision.md), function signatures with lifetimes have a few "
-"constraints:"
+"Ignoring [elision](elision.md), function signatures with lifetimes have a "
+"few constraints:"
msgstr ""
-"排除[省略(elision)](elision.md)的情况,带有生命周期的函数签名有以下几个约束:"
+"排除[省略(elision)](elision.md)的情况,带有生命周期的函数签名有以下几个约"
+"束:"
#: src/scope/lifetime/fn.md:5
msgid "any reference _must_ have an annotated lifetime."
-msgstr ""
-"任何引用**必须**有一个标注的生命周期。"
+msgstr "任何引用**必须**有一个标注的生命周期。"
#: src/scope/lifetime/fn.md:6
msgid ""
"any reference being returned _must_ have the same lifetime as an input or be "
"`static`."
-msgstr ""
-"任何被返回的引用**必须**具有与输入相同的生命周期或者是 `static`。"
+msgstr "任何被返回的引用**必须**具有与输入相同的生命周期或者是 `static`。"
#: src/scope/lifetime/fn.md:9
msgid ""
@@ -9456,24 +9748,22 @@
"would result in returning references to invalid data. The following example "
"shows off some valid forms of functions with lifetimes:"
msgstr ""
-"此外,请注意,如果返回引用而没有输入会导致返回指向无效数据的引用,这是被禁止的。以下示例展示了一些带有生命周期的有效函数形式:"
+"此外,请注意,如果返回引用而没有输入会导致返回指向无效数据的引用,这是被禁止"
+"的。以下示例展示了一些带有生命周期的有效函数形式:"
#: src/scope/lifetime/fn.md:14
msgid ""
"// One input reference with lifetime `'a` which must live\n"
"// at least as long as the function.\n"
-msgstr ""
-"// 一个具有生命周期 `'a` 的输入引用,它必须至少与函数存活一样长。\n"
+msgstr "// 一个具有生命周期 `'a` 的输入引用,它必须至少与函数存活一样长。\n"
#: src/scope/lifetime/fn.md:17
msgid "\"`print_one`: x is {}\""
-msgstr ""
-"\"`print_one`:x 是 {}\""
+msgstr "\"`print_one`:x 是 {}\""
#: src/scope/lifetime/fn.md:19
msgid "// Mutable references are possible with lifetimes as well.\n"
-msgstr ""
-"// 可变引用也可以有生命周期。\n"
+msgstr "// 可变引用也可以有生命周期。\n"
#: src/scope/lifetime/fn.md:24
msgid ""
@@ -9487,8 +9777,7 @@
#: src/scope/lifetime/fn.md:29
msgid "\"`print_multi`: x is {}, y is {}\""
-msgstr ""
-"\"`print_multi`:x 是 {},y 是 {}\""
+msgstr "\"`print_multi`:x 是 {},y 是 {}\""
#: src/scope/lifetime/fn.md:31
msgid ""
@@ -9513,33 +9802,27 @@
#: src/scope/lifetime/fn.md:60
msgid "[Functions](../../fn.md)"
-msgstr ""
-"[函数](../../fn.md)"
+msgstr "[函数](../../fn.md)"
#: src/scope/lifetime/methods.md:3
msgid "Methods are annotated similarly to functions:"
-msgstr ""
-"方法的生命周期注解与函数类似:"
+msgstr "方法的生命周期注解与函数类似:"
#: src/scope/lifetime/methods.md:9
msgid "// Annotate lifetimes as in a standalone function.\n"
-msgstr ""
-"// 像独立函数一样注解生命周期。\n"
+msgstr "// 像独立函数一样注解生命周期。\n"
#: src/scope/lifetime/methods.md:12
msgid "\"`print`: {}\""
-msgstr ""
-"\"`print`:{}\""
+msgstr "\"`print`:{}\""
#: src/scope/lifetime/methods.md:26
msgid "[methods](../../fn/methods.md)"
-msgstr ""
-"[方法](../../fn/methods.md)"
+msgstr "[方法](../../fn/methods.md)"
#: src/scope/lifetime/struct.md:3
msgid "Annotation of lifetimes in structures are also similar to functions:"
-msgstr ""
-"结构体中生命周期的注解也与函数类似:"
+msgstr "结构体中生命周期的注解也与函数类似:"
#: src/scope/lifetime/struct.md:6
msgid ""
@@ -9551,50 +9834,43 @@
#: src/scope/lifetime/struct.md:10
msgid "// Similarly, both references here must outlive this structure.\n"
-msgstr ""
-"// 同样,这里的两个引用都必须比这个结构体存活更久。\n"
+msgstr "// 同样,这里的两个引用都必须比这个结构体存活更久。\n"
#: src/scope/lifetime/struct.md:17
msgid "// An enum which is either an `i32` or a reference to one.\n"
-msgstr ""
-"// 一个枚举,可以是 `i32`,或者是 `i32` 的引用。\n"
+msgstr "// 一个枚举,可以是 `i32`,或者是 `i32` 的引用。\n"
#: src/scope/lifetime/struct.md:34 src/scope/lifetime/struct.md:36
msgid "\"x is borrowed in {:?}\""
-msgstr ""
-"\"x 在 {:?} 中被借用\""
+msgstr "\"x 在 {:?} 中被借用\""
#: src/scope/lifetime/struct.md:35
msgid "\"x and y are borrowed in {:?}\""
-msgstr ""
-"\"x 和 y 在 {:?} 中被借用\""
+msgstr "\"x 和 y 在 {:?} 中被借用\""
#: src/scope/lifetime/struct.md:37
msgid "\"y is *not* borrowed in {:?}\""
-msgstr ""
-"\"y 在 {:?} 中**没有**被借用\""
+msgstr "\"y 在 {:?} 中**没有**被借用\""
#: src/scope/lifetime/struct.md:43
msgid "[`struct`s](../../custom_types/structs.md)"
-msgstr ""
-"[`struct`(结构体)](../../custom_types/structs.md)"
+msgstr "[`struct`(结构体)](../../custom_types/structs.md)"
#: src/scope/lifetime/trait.md:3
msgid ""
"Annotation of lifetimes in trait methods basically are similar to functions. "
"Note that `impl` may have annotation of lifetimes too."
msgstr ""
-"trait 方法中的生命周期注解基本上与函数类似。注意,`impl` 也可能需要生命周期注解。"
+"trait 方法中的生命周期注解基本上与函数类似。注意,`impl` 也可能需要生命周期注"
+"解。"
#: src/scope/lifetime/trait.md:7
msgid "// A struct with annotation of lifetimes.\n"
-msgstr ""
-"// 一个带有生命周期注解的结构体。\n"
+msgstr "// 一个带有生命周期注解的结构体。\n"
#: src/scope/lifetime/trait.md:12
msgid "// Annotate lifetimes to impl.\n"
-msgstr ""
-"// 为 impl 添加生命周期注解。\n"
+msgstr "// 为 impl 添加生命周期注解。\n"
#: src/scope/lifetime/trait.md:24
msgid "\"b is {:?}\""
@@ -9610,8 +9886,8 @@
"bounds as well. The `:` character has a slightly different meaning here, but "
"`+` is the same. Note how the following read:"
msgstr ""
-"正如泛型类型可以被约束一样,生命周期(本身也是泛型)也可以使用约束。"
-"这里的 `:` 符号含义略有不同,但 `+` 的用法相同。请注意以下表达的含义:"
+"正如泛型类型可以被约束一样,生命周期(本身也是泛型)也可以使用约束。这里的 "
+"`:` 符号含义略有不同,但 `+` 的用法相同。请注意以下表达的含义:"
#: src/scope/lifetime/lifetime_bounds.md:7
msgid "`T: 'a`: _All_ references in `T` must outlive lifetime `'a`."
@@ -9621,11 +9897,14 @@
msgid ""
"`T: Trait + 'a`: Type `T` must implement trait `Trait` and _all_ references "
"in `T` must outlive `'a`."
-msgstr "`T: Trait + 'a`:类型 `T` 必须实现 trait `Trait`,并且 `T` 中的**所有**引用必须比 `'a` 存活更久。"
+msgstr ""
+"`T: Trait + 'a`:类型 `T` 必须实现 trait `Trait`,并且 `T` 中的**所有**引用必"
+"须比 `'a` 存活更久。"
#: src/scope/lifetime/lifetime_bounds.md:11
msgid ""
-"The example below shows the above syntax in action used after keyword `where`:"
+"The example below shows the above syntax in action used after keyword "
+"`where`:"
msgstr "下面的例子展示了上述语法在 `where` 关键字之后的实际应用:"
#: src/scope/lifetime/lifetime_bounds.md:14
@@ -9640,7 +9919,8 @@
"// of `Ref` may not exceed `'a`.\n"
msgstr ""
"// `Ref` 包含一个指向泛型类型 `T` 的引用,`T` 具有一个 `Ref` 未知的\n"
-"// 生命周期 `'a`。`T` 受到约束,使得 `T` 中的任何*引用*必须比 `'a` 存活更久。\n"
+"// 生命周期 `'a`。`T` 受到约束,使得 `T` 中的任何*引用*必须比 `'a` 存活更"
+"久。\n"
"// 此外,`Ref` 的生命周期不能超过 `'a`。\n"
#: src/scope/lifetime/lifetime_bounds.md:22
@@ -9667,20 +9947,22 @@
#: src/scope/lifetime/lifetime_bounds.md:48
msgid ""
-"[generics](../../generics.md), [bounds in generics](../../generics/bounds."
-"md), and [multiple bounds in generics](../../generics/multi_bounds.md)"
+"[generics](../../generics.md), [bounds in generics](../../generics/"
+"bounds.md), and [multiple bounds in generics](../../generics/multi_bounds.md)"
msgstr ""
-"[泛型](../../generics.md)、[泛型中的约束](../../generics/bounds.md)和[泛型中的多重约束](../../generics/multi_bounds.md)"
+"[泛型](../../generics.md)、[泛型中的约束](../../generics/bounds.md)和[泛型中"
+"的多重约束](../../generics/multi_bounds.md)"
#: src/scope/lifetime/lifetime_coercion.md:3
msgid ""
-"A longer lifetime can be coerced into a shorter one so that it works inside a "
-"scope it normally wouldn't work in. This comes in the form of inferred "
+"A longer lifetime can be coerced into a shorter one so that it works inside "
+"a scope it normally wouldn't work in. This comes in the form of inferred "
"coercion by the Rust compiler, and also in the form of declaring a lifetime "
"difference:"
msgstr ""
-"一个较长的生命周期可以被强制转换为一个较短的生命周期,使其能在通常无法工作的作用域内工作。"
-"这种转换可以通过 Rust 编译器的推断自动完成,也可以通过声明不同的生命周期的形式实现:"
+"一个较长的生命周期可以被强制转换为一个较短的生命周期,使其能在通常无法工作的"
+"作用域内工作。这种转换可以通过 Rust 编译器的推断自动完成,也可以通过声明不同"
+"的生命周期的形式实现:"
#: src/scope/lifetime/lifetime_coercion.md:9
msgid ""
@@ -9720,7 +10002,8 @@
"Rust has a few reserved lifetime names. One of those is `'static`. You might "
"encounter it in two situations:"
msgstr ""
-"Rust 有几个保留的生命周期名称。其中之一是 `'static`。你可能在两种情况下遇到它:"
+"Rust 有几个保留的生命周期名称。其中之一是 `'static`。你可能在两种情况下遇到"
+"它:"
#: src/scope/lifetime/static_lifetime.md:7
msgid "// A reference with 'static lifetime:\n"
@@ -9739,7 +10022,8 @@
"Both are related but subtly different and this is a common source for "
"confusion when learning Rust. Here are some examples for each situation:"
msgstr ""
-"这两种情况虽然相关但有微妙的区别,这也是学习 Rust 时常见的困惑来源。以下是每种情况的一些例子:"
+"这两种情况虽然相关但有微妙的区别,这也是学习 Rust 时常见的困惑来源。以下是每"
+"种情况的一些例子:"
#: src/scope/lifetime/static_lifetime.md:17
msgid "Reference lifetime"
@@ -9751,15 +10035,16 @@
"reference lives for the remaining lifetime of the running program. It can "
"still be coerced to a shorter lifetime."
msgstr ""
-"作为引用生命周期,`'static` 表示该引用指向的数据在程序的整个剩余运行期间都有效。"
-"它仍然可以被强制转换为更短的生命周期。"
+"作为引用生命周期,`'static` 表示该引用指向的数据在程序的整个剩余运行期间都有"
+"效。它仍然可以被强制转换为更短的生命周期。"
#: src/scope/lifetime/static_lifetime.md:23
msgid ""
"There are two common ways to make a variable with `'static` lifetime, and "
"both are stored in the read-only memory of the binary:"
msgstr ""
-"有两种常见的方法可以创建具有 `'static` 生命周期的变量,它们都存储在二进制文件的只读内存中:"
+"有两种常见的方法可以创建具有 `'static` 生命周期的变量,它们都存储在二进制文件"
+"的只读内存中:"
#: src/scope/lifetime/static_lifetime.md:26
msgid "Make a constant with the `static` declaration."
@@ -9828,9 +10113,12 @@
"demonstrate, the below example uses [`Box::leak`](https://doc.rust-lang.org/"
"std/boxed/struct.Box.html#method.leak) to dynamically create `'static` "
"references. In that case it definitely doesn't live for the entire duration, "
-"but only for the leaking point onward."
+"but only from the leaking point onward."
msgstr ""
-"`'static` 引用只需在程序生命周期的**剩余部分**有效,因此可以在程序执行过程中创建。为了演示这一点,下面的例子使用 [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak) 动态创建 `'static` 引用。在这种情况下,它显然不会存在于整个程序生命周期,而只是从泄漏点开始存在。"
+"`'static` 引用只需在程序生命周期的**剩余部分**有效,因此可以在程序执行过程中"
+"创建。为了演示这一点,下面的例子使用 [`Box::leak`](https://doc.rust-lang.org/"
+"std/boxed/struct.Box.html#method.leak) 动态创建 `'static` 引用。在这种情况"
+"下,它显然不会存在于整个程序生命周期,而只是从泄漏点开始存在。"
#: src/scope/lifetime/static_lifetime.md:90
msgid "Trait bound"
@@ -9839,10 +10127,11 @@
#: src/scope/lifetime/static_lifetime.md:92
msgid ""
"As a trait bound, it means the type does not contain any non-static "
-"references. Eg. the receiver can hold on to the type for as long as they want "
-"and it will never become invalid until they drop it."
+"references. Eg. the receiver can hold on to the type for as long as they "
+"want and it will never become invalid until they drop it."
msgstr ""
-"作为 trait 约束时,它表示该类型不包含任何非静态引用。例如,接收者可以随意持有该类型,直到主动丢弃之前,它都不会变为无效。"
+"作为 trait 约束时,它表示该类型不包含任何非静态引用。例如,接收者可以随意持有"
+"该类型,直到主动丢弃之前,它都不会变为无效。"
#: src/scope/lifetime/static_lifetime.md:96
msgid ""
@@ -9850,7 +10139,8 @@
"`'static` lifetime bound, but a reference to that owned data generally does "
"not:"
msgstr ""
-"理解这一点很重要:任何拥有所有权的数据总是满足 `'static` 生命周期约束,但对该数据的引用通常不满足:"
+"理解这一点很重要:任何拥有所有权的数据总是满足 `'static` 生命周期约束,但对该"
+"数据的引用通常不满足:"
#: src/scope/lifetime/static_lifetime.md:104
msgid "\"'static value passed in is: {:?}\""
@@ -9868,11 +10158,11 @@
"// 糟糕,&i 的生命周期仅由 main() 的作用域定义,\n"
" // 所以它不是 'static 的:\n"
-#: src/scope/lifetime/static_lifetime.md:117
+#: src/scope/lifetime/static_lifetime.md:118
msgid "The compiler will tell you:"
msgstr "编译器会提示你:"
-#: src/scope/lifetime/static_lifetime.md:133
+#: src/scope/lifetime/static_lifetime.md:135
msgid "[`'static` constants](../../custom_types/constants.md)"
msgstr "[`'static` 常量](../../custom_types/constants.md)"
@@ -9880,18 +10170,21 @@
msgid ""
"Some lifetime patterns are overwhelmingly common and so the borrow checker "
"will allow you to omit them to save typing and to improve readability. This "
-"is known as elision. Elision exists in Rust solely because these patterns are "
-"common."
+"is known as elision. Elision exists in Rust solely because these patterns "
+"are common."
msgstr ""
-"有些生命周期模式非常常见,因此借用检查器允许省略它们以减少代码量并提高可读性。这被称为省略。Rust 中的省略存在的唯一原因是这些模式很常见。"
+"有些生命周期模式非常常见,因此借用检查器允许省略它们以减少代码量并提高可读"
+"性。这被称为省略。Rust 中的省略存在的唯一原因是这些模式很常见。"
#: src/scope/lifetime/elision.md:8
msgid ""
"The following code shows a few examples of elision. For a more comprehensive "
-"description of elision, see [lifetime elision](https://doc.rust-lang.org/book/"
-"ch10-03-lifetime-syntax.html#lifetime-elision) in the book."
+"description of elision, see [lifetime elision](https://doc.rust-lang.org/"
+"book/ch10-03-lifetime-syntax.html#lifetime-elision) in the book."
msgstr ""
-"以下代码展示了一些省略的例子。要更全面地了解省略,请参阅 Rust 程序设计语言中的[生命周期省略](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#lifetime-elision)章节。"
+"以下代码展示了一些省略的例子。要更全面地了解省略,请参阅 Rust 程序设计语言中"
+"的[生命周期省略](https://doc.rust-lang.org/book/ch10-03-lifetime-"
+"syntax.html#lifetime-elision)章节。"
#: src/scope/lifetime/elision.md:12
msgid ""
@@ -9928,18 +10221,19 @@
#: src/scope/lifetime/elision.md:41
msgid ""
-"[elision](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax."
-"html#lifetime-elision)"
+"[elision](https://doc.rust-lang.org/book/ch10-03-lifetime-"
+"syntax.html#lifetime-elision)"
msgstr ""
-"[省略](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax."
-"html#lifetime-elision)"
+"[省略](https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#lifetime-"
+"elision)"
#: src/trait.md:3
msgid ""
"A `trait` is a collection of methods defined for an unknown type: `Self`. "
"They can access other methods declared in the same trait."
msgstr ""
-"`trait` 是为未知类型 `Self` 定义的一组方法集合。这些方法可以访问同一 trait 中声明的其他方法。"
+"`trait` 是为未知类型 `Self` 定义的一组方法集合。这些方法可以访问同一 trait 中"
+"声明的其他方法。"
#: src/trait.md:6
msgid ""
@@ -9948,13 +10242,14 @@
"the `Sheep` data type, allowing the use of methods from `Animal` with a "
"`Sheep`."
msgstr ""
-"trait 可以为任何数据类型实现。在下面的例子中,我们定义了 `Animal`,一组方法的集合。然后为 `Sheep` 数据类型实现 `Animal` trait,这样就可以对 `Sheep` 使用 `Animal` 中的方法。"
+"trait 可以为任何数据类型实现。在下面的例子中,我们定义了 `Animal`,一组方法的"
+"集合。然后为 `Sheep` 数据类型实现 `Animal` trait,这样就可以对 `Sheep` 使用 "
+"`Animal` 中的方法。"
#: src/trait.md:15
msgid ""
"// Associated function signature; `Self` refers to the implementor type.\n"
-msgstr ""
-"// 关联函数签名;`Self` 指代实现者类型。\n"
+msgstr "// 关联函数签名;`Self` 指代实现者类型。\n"
#: src/trait.md:18
msgid "// Method signatures; these will return a string.\n"
@@ -9980,7 +10275,7 @@
msgid "\"{} gets a haircut!\""
msgstr "\"{} 剃了个毛!\""
-#: src/trait.md:44 src/trait/dyn.md:17
+#: src/trait.md:44 src/trait/dyn.md:25
msgid "// Implement the `Animal` trait for `Sheep`.\n"
msgstr "// 为 `Sheep` 实现 `Animal` trait\n"
@@ -9992,7 +10287,7 @@
msgid "\"baaaaah?\""
msgstr "\"咩~?\""
-#: src/trait.md:60 src/trait/dyn.md:21
+#: src/trait.md:60 src/trait/dyn.md:29
msgid "\"baaaaah!\""
msgstr "\"咩~!\""
@@ -10033,68 +10328,74 @@
msgid "The following is a list of derivable traits:"
msgstr "以下是可派生的 trait 列表:"
-#: src/trait/derive.md:8
+#: src/trait/derive.md:9
msgid ""
"Comparison traits: [`Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html), "
-"[`PartialEq`](https://doc.rust-lang.org/std/cmp/trait.PartialEq.html), [`Ord`]"
-"(https://doc.rust-lang.org/std/cmp/trait.Ord.html), [`PartialOrd`](https://"
-"doc.rust-lang.org/std/cmp/trait.PartialOrd.html)."
+"[`PartialEq`](https://doc.rust-lang.org/std/cmp/trait.PartialEq.html), "
+"[`Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html), [`PartialOrd`]"
+"(https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html)."
msgstr ""
"比较 trait:[`Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html)、"
-"[`PartialEq`](https://doc.rust-lang.org/std/cmp/trait.PartialEq.html)、[`Ord`]"
-"(https://doc.rust-lang.org/std/cmp/trait.Ord.html)、[`PartialOrd`](https://"
-"doc.rust-lang.org/std/cmp/trait.PartialOrd.html)。"
+"[`PartialEq`](https://doc.rust-lang.org/std/cmp/trait.PartialEq.html)、"
+"[`Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html)、[`PartialOrd`]"
+"(https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html)。"
-#: src/trait/derive.md:10
+#: src/trait/derive.md:11
msgid ""
"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html), to create "
"`T` from `&T` via a copy."
msgstr ""
-"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html),通过复制 `&T` 创建 `T`。"
+"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html),通过复制 "
+"`&T` 创建 `T`。"
-#: src/trait/derive.md:11
+#: src/trait/derive.md:12
msgid ""
"[`Copy`](https://doc.rust-lang.org/core/marker/trait.Copy.html), to give a "
"type 'copy semantics' instead of 'move semantics'."
msgstr ""
-"[`Copy`](https://doc.rust-lang.org/core/marker/trait.Copy.html),使类型具备"复制语义"而不是"移动语义"。"
+"[`Copy`](https://doc.rust-lang.org/core/marker/trait.Copy.html),使类型具备"
+"\"复制语义\"而不是\"移动语义\"。"
-#: src/trait/derive.md:12
+#: src/trait/derive.md:13
msgid ""
"[`Hash`](https://doc.rust-lang.org/std/hash/trait.Hash.html), to compute a "
"hash from `&T`."
msgstr ""
-"[`Hash`](https://doc.rust-lang.org/std/hash/trait.Hash.html),从 `&T` 计算哈希值。"
+"[`Hash`](https://doc.rust-lang.org/std/hash/trait.Hash.html),从 `&T` 计算哈"
+"希值。"
-#: src/trait/derive.md:13
+#: src/trait/derive.md:14
msgid ""
"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html), to "
"create an empty instance of a data type."
msgstr ""
-"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html),创建一个数据类型的空实例。"
+"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html),创建一"
+"个数据类型的空实例。"
-#: src/trait/derive.md:14
+#: src/trait/derive.md:15
msgid ""
"[`Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html), to format a "
"value using the `{:?}` formatter."
msgstr ""
-"[`Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html),使用 `{:?}` 格式化器来格式化一个值。"
+"[`Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html),使用 `{:?}` 格"
+"式化器来格式化一个值。"
-#: src/trait/derive.md:17
+#: src/trait/derive.md:18
msgid "// `Centimeters`, a tuple struct that can be compared\n"
msgstr "// `Centimeters`,一个可比较的元组结构体\n"
-#: src/trait/derive.md:20
+#: src/trait/derive.md:21
msgid "// `Inches`, a tuple struct that can be printed\n"
msgstr "// `Inches`,一个可打印的元组结构体\n"
-#: src/trait/derive.md:32
+#: src/trait/derive.md:33
msgid "// `Seconds`, a tuple struct with no additional attributes\n"
msgstr "// `Seconds`,一个没有额外属性的元组结构体\n"
-#: src/trait/derive.md:39
+#: src/trait/derive.md:40
msgid ""
-"// Error: `Seconds` can't be printed; it doesn't implement the `Debug` trait\n"
+"// Error: `Seconds` can't be printed; it doesn't implement the `Debug` "
+"trait\n"
" //println!(\"One second looks like: {:?}\", _one_second);\n"
" // TODO ^ Try uncommenting this line\n"
msgstr ""
@@ -10102,7 +10403,7 @@
" //println!(\"One second looks like: {:?}\", _one_second);\n"
" // TODO ^ 尝试取消这行的注释\n"
-#: src/trait/derive.md:43
+#: src/trait/derive.md:44
msgid ""
"// Error: `Seconds` can't be compared; it doesn't implement the `PartialEq` "
"trait\n"
@@ -10113,23 +10414,23 @@
" //let _this_is_true = (_one_second == _one_second);\n"
" // TODO ^ 尝试取消这行的注释\n"
-#: src/trait/derive.md:49
+#: src/trait/derive.md:50
msgid "\"One foot equals {:?}\""
msgstr "\"一英尺等于 {:?}\""
-#: src/trait/derive.md:55
+#: src/trait/derive.md:56
msgid "\"smaller\""
msgstr "\"更小\""
-#: src/trait/derive.md:57
+#: src/trait/derive.md:58
msgid "\"bigger\""
msgstr "\"更大\""
-#: src/trait/derive.md:60
+#: src/trait/derive.md:61
msgid "\"One foot is {} than one meter.\""
msgstr "\"一英尺比一米{}\""
-#: src/trait/derive.md:65
+#: src/trait/derive.md:67
msgid "[`derive`](https://doc.rust-lang.org/reference/attributes.html#derive)"
msgstr "[`derive`](https://doc.rust-lang.org/reference/attributes.html#derive)"
@@ -10141,45 +10442,53 @@
"function that returns `Animal`, because its different implementations will "
"need different amounts of memory."
msgstr ""
-"Rust 编译器需要知道每个函数的返回类型所需的内存空间。这意味着所有函数都必须返回一个具体类型。与其他语言不同,如果你有一个像 `Animal` 这样的 trait,你不能编写一个直接返回 `Animal` 的函数,因为它的不同实现可能需要不同大小的内存。"
+"Rust 编译器需要知道每个函数的返回类型所需的内存空间。这意味着所有函数都必须返"
+"回一个具体类型。与其他语言不同,如果你有一个像 `Animal` 这样的 trait,你不能"
+"编写一个直接返回 `Animal` 的函数,因为它的不同实现可能需要不同大小的内存。"
-#: src/trait/dyn.md:5
+#: src/trait/dyn.md:8
msgid ""
"However, there's an easy workaround. Instead of returning a trait object "
"directly, our functions return a `Box` which _contains_ some `Animal`. A "
-"`box` is just a reference to some memory in the heap. Because a reference has "
-"a statically-known size, and the compiler can guarantee it points to a heap-"
-"allocated `Animal`, we can return a trait from our function!"
+"`box` is just a reference to some memory in the heap. Because a reference "
+"has a statically-known size, and the compiler can guarantee it points to a "
+"heap-allocated `Animal`, we can return a trait from our function!"
msgstr ""
-"然而,有一个简单的解决方法。我们可以让函数返回一个**包含** `Animal` 的 `Box`,而不是直接返回 trait 对象。`Box` 本质上是一个指向堆内存的引用。由于引用的大小是静态已知的,且编译器可以保证它指向堆上分配的 `Animal`,这样我们就能从函数中返回一个 trait 了!"
+"然而,有一个简单的解决方法。我们可以让函数返回一个**包含** `Animal` 的 "
+"`Box`,而不是直接返回 trait 对象。`Box` 本质上是一个指向堆内存的引用。由于引"
+"用的大小是静态已知的,且编译器可以保证它指向堆上分配的 `Animal`,这样我们就能"
+"从函数中返回一个 trait 了!"
-#: src/trait/dyn.md:7
+#: src/trait/dyn.md:13
msgid ""
"Rust tries to be as explicit as possible whenever it allocates memory on the "
-"heap. So if your function returns a pointer-to-trait-on-heap in this way, you "
-"need to write the return type with the `dyn` keyword, e.g. `Box<dyn Animal>`."
+"heap. So if your function returns a pointer-to-trait-on-heap in this way, "
+"you need to write the return type with the `dyn` keyword, e.g. `Box<dyn "
+"Animal>`."
msgstr ""
-"Rust 在堆上分配内存时力求明确。因此,如果你的函数以这种方式返回一个指向堆上 trait 的指针,你需要在返回类型中使用 `dyn` 关键字,例如 `Box<dyn Animal>`。"
+"Rust 在堆上分配内存时力求明确。因此,如果你的函数以这种方式返回一个指向堆上 "
+"trait 的指针,你需要在返回类型中使用 `dyn` 关键字,例如 `Box<dyn Animal>`。"
-#: src/trait/dyn.md:14
+#: src/trait/dyn.md:22
msgid "// Instance method signature\n"
msgstr "// 实例方法签名\n"
-#: src/trait/dyn.md:24
+#: src/trait/dyn.md:32
msgid "// Implement the `Animal` trait for `Cow`.\n"
msgstr "// 为 `Cow` 实现 `Animal` trait\n"
-#: src/trait/dyn.md:28
+#: src/trait/dyn.md:36
msgid "\"moooooo!\""
msgstr "\"哞~哞~哞~\""
-#: src/trait/dyn.md:31
+#: src/trait/dyn.md:39
msgid ""
-"// Returns some struct that implements Animal, but we don't know which one at "
-"compile time.\n"
-msgstr "// 返回某个实现了 Animal 的结构体,但在编译时我们并不知道具体是哪一个\n"
+"// Returns some struct that implements Animal, but we don't know which one "
+"at compile time.\n"
+msgstr ""
+"// 返回某个实现了 Animal 的结构体,但在编译时我们并不知道具体是哪一个\n"
-#: src/trait/dyn.md:44
+#: src/trait/dyn.md:52
msgid "\"You've randomly chosen an animal, and it says {}\""
msgstr "\"你随机选择了一个动物,它说:{}\""
@@ -10188,18 +10497,23 @@
"In Rust, many of the operators can be overloaded via traits. That is, some "
"operators can be used to accomplish different tasks based on their input "
"arguments. This is possible because operators are syntactic sugar for method "
-"calls. For example, the `+` operator in `a + b` calls the `add` method (as in "
-"`a.add(b)`). This `add` method is part of the `Add` trait. Hence, the `+` "
+"calls. For example, the `+` operator in `a + b` calls the `add` method (as "
+"in `a.add(b)`). This `add` method is part of the `Add` trait. Hence, the `+` "
"operator can be used by any implementor of the `Add` trait."
msgstr ""
-"在 Rust 中,许多运算符可以通过 trait 进行重载。这意味着某些运算符可以根据输入参数执行不同的任务。之所以可能,是因为运算符实际上是方法调用的语法糖。例如,`a + b` 中的 `+` 运算符会调用 `add` 方法(相当于 `a.add(b)`)。这个 `add` 方法是 `Add` trait 的一部分。因此,任何实现了 `Add` trait 的类型都可以使用 `+` 运算符。"
+"在 Rust 中,许多运算符可以通过 trait 进行重载。这意味着某些运算符可以根据输入"
+"参数执行不同的任务。之所以可能,是因为运算符实际上是方法调用的语法糖。例如,"
+"`a + b` 中的 `+` 运算符会调用 `add` 方法(相当于 `a.add(b)`)。这个 `add` 方"
+"法是 `Add` trait 的一部分。因此,任何实现了 `Add` trait 的类型都可以使用 `+` "
+"运算符。"
#: src/trait/ops.md:9
msgid ""
"A list of the traits, such as `Add`, that overload operators can be found in "
"[`core::ops`](https://doc.rust-lang.org/core/ops/)."
msgstr ""
-"可以在 [`core::ops`](https://doc.rust-lang.org/core/ops/) 模块中找到用于重载运算符的 trait 列表,如 `Add` 等。"
+"可以在 [`core::ops`](https://doc.rust-lang.org/core/ops/) 模块中找到用于重载"
+"运算符的 trait 列表,如 `Add` 等。"
#: src/trait/ops.md:22
msgid ""
@@ -10239,7 +10553,7 @@
msgid "\"Bar + Foo = {:?}\""
msgstr "\"Bar + Foo = {:?}\""
-#: src/trait/ops.md:55 src/testing.md:16 src/testing/doc_testing.md:104
+#: src/trait/ops.md:55 src/testing.md:16 src/testing/doc_testing.md:105
#: src/testing/dev_dependencies.md:36
msgid "See Also"
msgstr "参见"
@@ -10249,27 +10563,28 @@
"[Add](https://doc.rust-lang.org/core/ops/trait.Add.html), [Syntax Index]"
"(https://doc.rust-lang.org/book/appendix-02-operators.html)"
msgstr ""
-"[Add](https://doc.rust-lang.org/core/ops/trait.Add.html),[语法索引]"
-"(https://doc.rust-lang.org/book/appendix-02-operators.html)"
+"[Add](https://doc.rust-lang.org/core/ops/trait.Add.html),[语法索引](https://"
+"doc.rust-lang.org/book/appendix-02-operators.html)"
#: src/trait/drop.md:3
msgid ""
"The [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) trait only "
-"has one method: `drop`, which is called automatically when an object goes out "
-"of scope. The main use of the `Drop` trait is to free the resources that the "
-"implementor instance owns."
+"has one method: `drop`, which is called automatically when an object goes "
+"out of scope. The main use of the `Drop` trait is to free the resources that "
+"the implementor instance owns."
msgstr ""
-"[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) trait 只有一个方法:`drop`,"
-"它会在对象离开作用域时自动调用。`Drop` trait 的主要用途是释放实现该 trait 的实例所拥有的资源。"
+"[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) trait 只有一个方"
+"法:`drop`,它会在对象离开作用域时自动调用。`Drop` trait 的主要用途是释放实现"
+"该 trait 的实例所拥有的资源。"
#: src/trait/drop.md:7
msgid ""
-"`Box`, `Vec`, `String`, `File`, and `Process` are some examples of types that "
-"implement the `Drop` trait to free resources. The `Drop` trait can also be "
-"manually implemented for any custom data type."
+"`Box`, `Vec`, `String`, `File`, and `Process` are some examples of types "
+"that implement the `Drop` trait to free resources. The `Drop` trait can also "
+"be manually implemented for any custom data type."
msgstr ""
-"`Box`、`Vec`、`String`、`File` 和 `Process` 是一些实现了 `Drop` trait 以释放资源的类型示例。"
-"你也可以为任何自定义数据类型手动实现 `Drop` trait。"
+"`Box`、`Vec`、`String`、`File` 和 `Process` 是一些实现了 `Drop` trait 以释放"
+"资源的类型示例。你也可以为任何自定义数据类型手动实现 `Drop` trait。"
#: src/trait/drop.md:11
msgid ""
@@ -10347,6 +10662,76 @@
"// `_a` 在这里**不会**被再次 `drop`,因为它已经\n"
" // 被(手动)`drop` 过了\n"
+#: src/trait/drop.md:57
+msgid ""
+"For a more practical example, here's how the `Drop` trait can be used to "
+"automatically clean up temporary files when they're no longer needed:"
+msgstr ""
+"下面是一个更实用的例子,展示如何使用 `Drop` 特质在不再需要临时文件时自动清理"
+"它们:"
+
+#: src/trait/drop.md:71
+msgid "// Note: File::create() will overwrite existing files\n"
+msgstr "// 注意:File::create() 会覆盖现有文件\n"
+
+#: src/trait/drop.md:77
+msgid ""
+"// When TempFile is dropped:\n"
+"// 1. First, the File will be automatically closed (Drop for File)\n"
+"// 2. Then our drop implementation will remove the file\n"
+msgstr ""
+"// 当 TempFile 被丢弃时:\n"
+"// 1. 首先,File 会自动关闭(File 的 Drop 实现)\n"
+"// 2. 然后我们的 drop 实现会删除文件\n"
+
+#: src/trait/drop.md:83
+msgid "// Note: File is already closed at this point\n"
+msgstr "// 注意:文件在此时已经关闭\n"
+
+#: src/trait/drop.md:85
+msgid "\"Failed to remove temporary file: {}\""
+msgstr "\"删除临时文件失败:{}\""
+
+#: src/trait/drop.md:87
+msgid "\"> Dropped temporary file: {:?}\""
+msgstr "\"> 已丢弃临时文件:{:?}\""
+
+#: src/trait/drop.md:92
+msgid "// Create a new scope to demonstrate drop behavior\n"
+msgstr "// 创建新作用域来演示丢弃行为\n"
+
+#: src/trait/drop.md:94
+msgid "\"test.txt\""
+msgstr "\"test.txt\""
+
+#: src/trait/drop.md:95
+msgid "\"Temporary file created\""
+msgstr "\"已创建临时文件\""
+
+#: src/trait/drop.md:96
+msgid "// File will be automatically cleaned up when temp goes out of scope\n"
+msgstr "// 当 temp 超出作用域时,文件会自动清理\n"
+
+#: src/trait/drop.md:98
+msgid "\"End of scope - file should be cleaned up\""
+msgstr "\"作用域结束 - 文件应该被清理\""
+
+#: src/trait/drop.md:100
+msgid "// We can also manually drop if needed\n"
+msgstr "// 如果需要,我们也可以手动丢弃\n"
+
+#: src/trait/drop.md:101
+msgid "\"another_test.txt\""
+msgstr "\"another_test.txt\""
+
+#: src/trait/drop.md:102
+msgid "// Explicitly drop the file\n"
+msgstr "// 显式丢弃文件\n"
+
+#: src/trait/drop.md:103
+msgid "\"Manually dropped file\""
+msgstr "\"手动丢弃的文件\""
+
#: src/trait/iter.md:3
msgid ""
"The [`Iterator`](https://doc.rust-lang.org/core/iter/trait.Iterator.html) "
@@ -10361,8 +10746,8 @@
"may be manually defined in an `impl` block or automatically defined (as in "
"arrays and ranges)."
msgstr ""
-"该 trait 只要求为 `next` 元素定义一个方法,这个方法可以在 `impl` 块中手动定义,"
-"也可以自动定义(如在数组和区间中)。"
+"该 trait 只要求为 `next` 元素定义一个方法,这个方法可以在 `impl` 块中手动定"
+"义,也可以自动定义(如在数组和区间中)。"
#: src/trait/iter.md:10
msgid ""
@@ -10377,16 +10762,18 @@
msgid ""
"// Implement `Iterator` for `Fibonacci`.\n"
"// The `Iterator` trait only requires a method to be defined for the `next` "
-"element.\n"
+"element,\n"
+"// and an `associated type` to declare the return type of the iterator.\n"
msgstr ""
"// 为 `Fibonacci` 实现 `Iterator`。\n"
-"// `Iterator` trait 只要求为 `next` 元素定义一个方法。\n"
+"// `Iterator` 特质只要求为 `next` 元素定义一个方法,\n"
+"// 并需要一个`关联类型`来声明迭代器的返回类型。\n"
-#: src/trait/iter.md:22
+#: src/trait/iter.md:23
msgid "// We can refer to this type using Self::Item\n"
msgstr "// 我们可以使用 Self::Item 引用这个类型\n"
-#: src/trait/iter.md:25
+#: src/trait/iter.md:26
msgid ""
"// Here, we define the sequence using `.curr` and `.next`.\n"
" // The return type is `Option<T>`:\n"
@@ -10402,7 +10789,7 @@
" // 我们在返回类型中使用 Self::Item,这样可以更改\n"
" // 类型而无需更新函数签名。\n"
-#: src/trait/iter.md:37
+#: src/trait/iter.md:38
msgid ""
"// Since there's no endpoint to a Fibonacci sequence, the `Iterator` \n"
" // will never return `None`, and `Some` is always returned.\n"
@@ -10410,24 +10797,24 @@
"// 由于斐波那契序列没有终点,`Iterator` \n"
" // 永远不会返回 `None`,始终返回 `Some`。\n"
-#: src/trait/iter.md:42
+#: src/trait/iter.md:43
msgid "// Returns a Fibonacci sequence generator\n"
msgstr "// 返回一个斐波那契序列生成器\n"
-#: src/trait/iter.md:49
+#: src/trait/iter.md:50
msgid "// `0..3` is an `Iterator` that generates: 0, 1, and 2.\n"
msgstr "// `0..3` 是一个生成 0、1 和 2 的 `Iterator`。\n"
-#: src/trait/iter.md:52
+#: src/trait/iter.md:53
msgid "\"Four consecutive `next` calls on 0..3\""
msgstr "\"对 0..3 连续调用四次 `next`\""
-#: src/trait/iter.md:53 src/trait/iter.md:54 src/trait/iter.md:55
-#: src/trait/iter.md:56 src/std_misc/fs.md:90
+#: src/trait/iter.md:54 src/trait/iter.md:55 src/trait/iter.md:56
+#: src/trait/iter.md:57 src/std_misc/fs.md:90
msgid "\"> {:?}\""
msgstr "\"> {:?}\""
-#: src/trait/iter.md:58
+#: src/trait/iter.md:59
msgid ""
"// `for` works through an `Iterator` until it returns `None`.\n"
" // Each `Some` value is unwrapped and bound to a variable (here, `i`).\n"
@@ -10435,39 +10822,39 @@
"// `for` 遍历 `Iterator` 直到它返回 `None`。\n"
" // 每个 `Some` 值被解包并绑定到一个变量(这里是 `i`)。\n"
-#: src/trait/iter.md:60
+#: src/trait/iter.md:61
msgid "\"Iterate through 0..3 using `for`\""
msgstr "\"使用 `for` 遍历 0..3\""
-#: src/trait/iter.md:62 src/trait/iter.md:68 src/trait/iter.md:74
-#: src/trait/iter.md:82 src/std/vec.md:49 src/std/str.md:22
+#: src/trait/iter.md:63 src/trait/iter.md:69 src/trait/iter.md:75
+#: src/trait/iter.md:83 src/std/vec.md:50 src/std/str.md:22
#: src/std_misc/fs.md:82
msgid "\"> {}\""
msgstr "\"> {}\""
-#: src/trait/iter.md:65
+#: src/trait/iter.md:66
msgid "// The `take(n)` method reduces an `Iterator` to its first `n` terms.\n"
msgstr "// `take(n)` 方法将 `Iterator` 限制为其前 `n` 项。\n"
-#: src/trait/iter.md:66
+#: src/trait/iter.md:67
msgid "\"The first four terms of the Fibonacci sequence are: \""
msgstr "\"斐波那契序列的前四项是:\""
-#: src/trait/iter.md:71
+#: src/trait/iter.md:72
msgid ""
"// The `skip(n)` method shortens an `Iterator` by dropping its first `n` "
"terms.\n"
msgstr "// `skip(n)` 方法通过跳过前 `n` 项来缩短 `Iterator`。\n"
-#: src/trait/iter.md:72
+#: src/trait/iter.md:73
msgid "\"The next four terms of the Fibonacci sequence are: \""
msgstr "\"斐波那契序列的接下来四项是:\""
-#: src/trait/iter.md:79
+#: src/trait/iter.md:80
msgid "// The `iter` method produces an `Iterator` over an array/slice.\n"
msgstr "// `iter` 方法为数组/切片创建一个 `Iterator`。\n"
-#: src/trait/iter.md:80
+#: src/trait/iter.md:81
msgid "\"Iterate the following array {:?}\""
msgstr "\"遍历以下数组 {:?}\""
@@ -10493,8 +10880,8 @@
"type, you can simplify the function declaration using `impl Trait` as the "
"type of the argument."
msgstr ""
-"如果你的函数对某个 trait 是泛型的,但不关心具体类型,"
-"你可以使用 `impl Trait` 作为参数类型来简化函数声明。"
+"如果你的函数对某个 trait 是泛型的,但不关心具体类型,你可以使用 `impl Trait` "
+"作为参数类型来简化函数声明。"
#: src/trait/impl_trait.md:12
msgid "For example, consider the following code:"
@@ -10536,31 +10923,35 @@
"important what type `R` is, and `R` is only used to declare the type of "
"`src`, so the function can also be written as:"
msgstr ""
-"`parse_csv_document` 是泛型函数,可以接受任何实现了 `BufRead` 的类型,"
-"如 `BufReader<File>` 或 `[u8]`。但具体的 `R` 类型并不重要,`R` 仅用于声明 `src` 的类型。"
-"因此,这个函数也可以写成:"
+"`parse_csv_document` 是泛型函数,可以接受任何实现了 `BufRead` 的类型,如 "
+"`BufReader<File>` 或 `[u8]`。但具体的 `R` 类型并不重要,`R` 仅用于声明 `src` "
+"的类型。因此,这个函数也可以写成:"
#: src/trait/impl_trait.md:49
msgid ""
"Note that using `impl Trait` as an argument type means that you cannot "
-"explicitly state what form of the function you use, i.e. `parse_csv_document::"
-"<std::io::Empty>(std::io::empty())` will not work with the second example."
+"explicitly state what form of the function you use, i.e. "
+"`parse_csv_document::<std::io::Empty>(std::io::empty())` will not work with "
+"the second example."
msgstr ""
-"注意,使用 `impl Trait` 作为参数类型意味着你无法显式指定使用的函数形式。"
-"例如,`parse_csv_document::<std::io::Empty>(std::io::empty())` 在第二个例子中将无法工作。"
+"注意,使用 `impl Trait` 作为参数类型意味着你无法显式指定使用的函数形式。例"
+"如,`parse_csv_document::<std::io::Empty>(std::io::empty())` 在第二个例子中将"
+"无法工作。"
-#: src/trait/impl_trait.md:52
+#: src/trait/impl_trait.md:51
msgid "As a return type"
msgstr "作为返回类型"
-#: src/trait/impl_trait.md:54
+#: src/trait/impl_trait.md:53
msgid ""
"If your function returns a type that implements `MyTrait`, you can write its "
-"return type as `-> impl MyTrait`. This can help simplify your type signatures "
-"quite a lot!"
-msgstr "如果函数返回一个实现了 `MyTrait` 的类型,你可以将其返回类型写为 `-> impl MyTrait`。这可以大大简化类型签名!"
+"return type as `-> impl MyTrait`. This can help simplify your type "
+"signatures quite a lot!"
+msgstr ""
+"如果函数返回一个实现了 `MyTrait` 的类型,你可以将其返回类型写为 `-> impl "
+"MyTrait`。这可以大大简化类型签名!"
-#: src/trait/impl_trait.md:60
+#: src/trait/impl_trait.md:59
msgid ""
"// This function combines two `Vec<i32>` and returns an iterator over it.\n"
"// Look how complicated its return type is!\n"
@@ -10568,7 +10959,7 @@
"// 这个函数合并两个 `Vec<i32>` 并返回一个迭代器。\n"
"// 看看它的返回类型有多复杂!\n"
-#: src/trait/impl_trait.md:69
+#: src/trait/impl_trait.md:68
msgid ""
"// This is the exact same function, but its return type uses `impl Trait`.\n"
"// Look how much simpler it is!\n"
@@ -10576,26 +10967,26 @@
"// 这是完全相同的函数,但它的返回类型使用了 `impl Trait`。\n"
"// 看看它变得多么简单!\n"
-#: src/trait/impl_trait.md:88
+#: src/trait/impl_trait.md:87
msgid "\"all done\""
msgstr "\"全部完成\""
-#: src/trait/impl_trait.md:92
+#: src/trait/impl_trait.md:91
msgid ""
"More importantly, some Rust types can't be written out. For example, every "
"closure has its own unnamed concrete type. Before `impl Trait` syntax, you "
"had to allocate on the heap in order to return a closure. But now you can do "
"it all statically, like this:"
msgstr ""
-"更重要的是,某些 Rust 类型无法直接写出。例如,每个闭包都有自己的未命名具体类型。"
-"在 `impl Trait` 语法出现之前,你必须在堆上分配内存才能返回闭包。"
-"但现在你可以完全静态地做到这一点,像这样:"
+"更重要的是,某些 Rust 类型无法直接写出。例如,每个闭包都有自己的未命名具体类"
+"型。在 `impl Trait` 语法出现之前,你必须在堆上分配内存才能返回闭包。但现在你"
+"可以完全静态地做到这一点,像这样:"
-#: src/trait/impl_trait.md:98
+#: src/trait/impl_trait.md:97
msgid "// Returns a function that adds `y` to its input\n"
msgstr "// 返回一个将 `y` 加到输入值上的函数\n"
-#: src/trait/impl_trait.md:110
+#: src/trait/impl_trait.md:109
msgid ""
"You can also use `impl Trait` to return an iterator that uses `map` or "
"`filter` closures! This makes using `map` and `filter` easier. Because "
@@ -10603,10 +10994,9 @@
"if your function returns iterators with closures. But with `impl Trait` you "
"can do this easily:"
msgstr ""
-"你还可以使用 `impl Trait` 返回一个使用 `map` 或 `filter` 闭包的迭代器!"
-"这使得使用 `map` 和 `filter` 更加容易。由于闭包类型没有名称,"
-"如果你的函数返回带有闭包的迭代器,你无法写出显式的返回类型。"
-"但使用 `impl Trait`,你可以轻松实现:"
+"你还可以使用 `impl Trait` 返回一个使用 `map` 或 `filter` 闭包的迭代器!这使得"
+"使用 `map` 和 `filter` 更加容易。由于闭包类型没有名称,如果你的函数返回带有闭"
+"包的迭代器,你无法写出显式的返回类型。但使用 `impl Trait`,你可以轻松实现:"
#: src/trait/clone.md:3
msgid ""
@@ -10614,8 +11004,8 @@
"assignments or function calls. However, sometimes we need to make a copy of "
"the resource as well."
msgstr ""
-"在处理资源时,默认行为是在赋值或函数调用期间转移它们。"
-"然而,有时我们也需要复制资源。"
+"在处理资源时,默认行为是在赋值或函数调用期间转移它们。然而,有时我们也需要复"
+"制资源。"
#: src/trait/clone.md:7
msgid ""
@@ -10623,8 +11013,8 @@
"helps us do exactly this. Most commonly, we can use the `.clone()` method "
"defined by the `Clone` trait."
msgstr ""
-"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html) trait "
-"帮助我们实现这一点。最常见的是,我们可以使用 `Clone` trait 定义的 `.clone()` 方法。"
+"[`Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html) trait 帮助我"
+"们实现这一点。最常见的是,我们可以使用 `Clone` trait 定义的 `.clone()` 方法。"
#: src/trait/clone.md:11
msgid "// A unit struct without resources\n"
@@ -10736,12 +11126,12 @@
#: src/trait/supertraits.md:42
msgid ""
-"[The Rust Programming Language chapter on supertraits](https://doc.rust-lang."
-"org/book/ch19-03-advanced-traits.html#using-supertraits-to-require-one-traits-"
-"functionality-within-another-trait)"
+"[The Rust Programming Language chapter on supertraits](https://doc.rust-"
+"lang.org/book/ch19-03-advanced-traits.html#using-supertraits-to-require-one-"
+"traits-functionality-within-another-trait)"
msgstr ""
-"[《Rust 程序设计语言》中关于超 trait 的章节](https://doc.rust-lang."
-"org/book/ch19-03-advanced-traits.html#using-supertraits-to-require-one-traits-"
+"[《Rust 程序设计语言》中关于超 trait 的章节](https://doc.rust-lang.org/book/"
+"ch19-03-advanced-traits.html#using-supertraits-to-require-one-traits-"
"functionality-within-another-trait)"
#: src/trait/disambiguating.md:3
@@ -10750,22 +11140,25 @@
"the same name for a function? For example, many traits might have a method "
"named `get()`. They might even have different return types!"
msgstr ""
-"一个类型可以实现多个不同的 trait。如果两个 trait 都要求函数使用相同的名称,该怎么办?"
-"例如,许多 trait 可能都有一个名为 `get()` 的方法,它们甚至可能有不同的返回类型!"
+"一个类型可以实现多个不同的 trait。如果两个 trait 都要求函数使用相同的名称,该"
+"怎么办?例如,许多 trait 可能都有一个名为 `get()` 的方法,它们甚至可能有不同"
+"的返回类型!"
#: src/trait/disambiguating.md:7
msgid ""
"Good news: because each trait implementation gets its own `impl` block, it's "
"clear which trait's `get` method you're implementing."
msgstr ""
-"好消息是:由于每个 trait 实现都有自己的 `impl` 块,因此很容易分清楚你正在实现哪个 trait 的 `get` 方法。"
+"好消息是:由于每个 trait 实现都有自己的 `impl` 块,因此很容易分清楚你正在实现"
+"哪个 trait 的 `get` 方法。"
#: src/trait/disambiguating.md:10
msgid ""
"What about when it comes time to _call_ those methods? To disambiguate "
"between them, we have to use Fully Qualified Syntax."
msgstr ""
-"那么在调用这些方法时又该如何处理呢?为了消除它们之间的歧义,我们必须使用完全限定语法。"
+"那么在调用这些方法时又该如何处理呢?为了消除它们之间的歧义,我们必须使用完全"
+"限定语法。"
#: src/trait/disambiguating.md:15
msgid "// Get the selected username out of this widget\n"
@@ -10798,28 +11191,32 @@
#: src/trait/disambiguating.md:62
msgid ""
-"[The Rust Programming Language chapter on Fully Qualified syntax](https://doc."
-"rust-lang.org/book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-"
-"disambiguation-calling-methods-with-the-same-name)"
+"[The Rust Programming Language chapter on Fully Qualified syntax](https://"
+"doc.rust-lang.org/book/ch19-03-advanced-traits.html#fully-qualified-syntax-"
+"for-disambiguation-calling-methods-with-the-same-name)"
msgstr ""
-"[《Rust 程序设计语言》中关于完全限定语法的章节](https://doc."
-"rust-lang.org/book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-"
-"disambiguation-calling-methods-with-the-same-name)"
+"[《Rust 程序设计语言》中关于完全限定语法的章节](https://doc.rust-lang.org/"
+"book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-disambiguation-"
+"calling-methods-with-the-same-name)"
+
+#: src/macros.md:1
+msgid "`macro_rules!`"
+msgstr "`macro_rules!`"
#: src/macros.md:3
msgid ""
"Rust provides a powerful macro system that allows metaprogramming. As you've "
-"seen in previous chapters, macros look like functions, except that their name "
-"ends with a bang `!`, but instead of generating a function call, macros are "
-"expanded into source code that gets compiled with the rest of the program. "
-"However, unlike macros in C and other languages, Rust macros are expanded "
-"into abstract syntax trees, rather than string preprocessing, so you don't "
-"get unexpected precedence bugs."
+"seen in previous chapters, macros look like functions, except that their "
+"name ends with a bang `!`, but instead of generating a function call, macros "
+"are expanded into source code that gets compiled with the rest of the "
+"program. However, unlike macros in C and other languages, Rust macros are "
+"expanded into abstract syntax trees, rather than string preprocessing, so "
+"you don't get unexpected precedence bugs."
msgstr ""
-"Rust 提供了一个强大的宏系统,支持元编程。正如你在前面章节中所看到的,宏看起来像函数,"
-"只是它们的名字以感叹号 `!` 结尾。但与生成函数调用不同,宏会展开成源代码,然后与程序的其余部分一起编译。"
-"与 C 和其他语言中的宏不同,Rust 宏展开成抽象语法树,而不是进行字符串预处理,"
-"因此你不会遇到意外的优先级错误。"
+"Rust 提供了一个强大的宏系统,支持元编程。正如你在前面章节中所看到的,宏看起来"
+"像函数,只是它们的名字以感叹号 `!` 结尾。但与生成函数调用不同,宏会展开成源代"
+"码,然后与程序的其余部分一起编译。与 C 和其他语言中的宏不同,Rust 宏展开成抽"
+"象语法树,而不是进行字符串预处理,因此你不会遇到意外的优先级错误。"
#: src/macros.md:11
msgid "Macros are created using the `macro_rules!` macro."
@@ -10862,8 +11259,7 @@
msgid ""
"Domain-specific languages. Macros allow you to define special syntax for a "
"specific purpose. (More on this later)"
-msgstr ""
-"领域特定语言。宏允许你为特定目的定义专门的语法。(稍后会详细介绍)"
+msgstr "领域特定语言。宏允许你为特定目的定义专门的语法。(稍后会详细介绍)"
#: src/macros.md:38
msgid ""
@@ -10871,15 +11267,14 @@
"variable number of arguments. An example is `println!` which could take any "
"number of arguments, depending on the format string. (More on this later)"
msgstr ""
-"可变参数接口。有时你可能想定义一个接受可变数量参数的接口。"
-"例如 `println!`,它可以根据格式字符串接受任意数量的参数。(稍后会详细介绍)"
+"可变参数接口。有时你可能想定义一个接受可变数量参数的接口。例如 `println!`,它"
+"可以根据格式字符串接受任意数量的参数。(稍后会详细介绍)"
#: src/macros/syntax.md:3
msgid ""
"In following subsections, we will show how to define macros in Rust. There "
"are three basic ideas:"
-msgstr ""
-"在接下来的小节中,我们将展示如何在 Rust 中定义宏。有三个基本概念:"
+msgstr "在接下来的小节中,我们将展示如何在 Rust 中定义宏。有三个基本概念:"
#: src/macros/syntax.md:6
msgid "[Patterns and Designators](designators.md)"
@@ -10895,10 +11290,9 @@
#: src/macros/designators.md:3
msgid ""
-"The arguments of a macro are prefixed by a dollar sign `$` and type annotated "
-"with a _designator_:"
-msgstr ""
-"宏的参数以美元符号 `$` 为前缀,并用**指示符**来标注类型:"
+"The arguments of a macro are prefixed by a dollar sign `$` and type "
+"annotated with a _designator_:"
+msgstr "宏的参数以美元符号 `$` 为前缀,并用**指示符**来标注类型:"
#: src/macros/designators.md:8
msgid ""
@@ -10997,14 +11391,16 @@
"For a complete list, see the [Rust Reference](https://doc.rust-lang.org/"
"reference/macros-by-example.html)."
msgstr ""
-"完整列表请参阅 [Rust 参考手册](https://doc.rust-lang.org/reference/macros-by-example.html)。"
+"完整列表请参阅 [Rust 参考手册](https://doc.rust-lang.org/reference/macros-by-"
+"example.html)。"
#: src/macros/overload.md:3
msgid ""
"Macros can be overloaded to accept different combinations of arguments. In "
"that regard, `macro_rules!` can work similarly to a match block:"
msgstr ""
-"宏可以被重载以接受不同的参数组合。在这方面,`macro_rules!` 的工作方式类似于 match 块:"
+"宏可以被重载以接受不同的参数组合。在这方面,`macro_rules!` 的工作方式类似于 "
+"match 块:"
#: src/macros/overload.md:7
msgid ""
@@ -11040,7 +11436,8 @@
"repeat at least once, or `*`, to indicate that the argument may repeat zero "
"or more times."
msgstr ""
-"宏可以在参数列表中使用 `+` 来表示一个参数可能重复至少一次,或使用 `*` 来表示一个参数可能重复零次或多次。"
+"宏可以在参数列表中使用 `+` 来表示一个参数可能重复至少一次,或使用 `*` 来表示"
+"一个参数可能重复零次或多次。"
#: src/macros/repeat.md:7
msgid ""
@@ -11073,8 +11470,9 @@
"and/or test suites. Here is an example that implements and tests the `+=`, "
"`*=` and `-=` operators on `Vec<T>`:"
msgstr ""
-"宏通过提取函数和/或测试套件的共同部分,使我们能够编写符合 DRY(Don't Repeat Yourself)原则的代码。"
-"下面是一个在 `Vec<T>` 上实现并测试 `+=`、`*=` 和 `-=` 运算符的示例:"
+"宏通过提取函数和/或测试套件的共同部分,使我们能够编写符合 DRY(Don't Repeat "
+"Yourself)原则的代码。下面是一个在 `Vec<T>` 上实现并测试 `+=`、`*=` 和 `-=` "
+"运算符的示例:"
#: src/macros/dry.md:11
msgid ""
@@ -11106,20 +11504,22 @@
#: src/macros/dsl.md:3
msgid ""
-"A DSL is a mini \"language\" embedded in a Rust macro. It is completely valid "
-"Rust because the macro system expands into normal Rust constructs, but it "
-"looks like a small language. This allows you to define concise or intuitive "
-"syntax for some special functionality (within bounds)."
+"A DSL is a mini \"language\" embedded in a Rust macro. It is completely "
+"valid Rust because the macro system expands into normal Rust constructs, but "
+"it looks like a small language. This allows you to define concise or "
+"intuitive syntax for some special functionality (within bounds)."
msgstr ""
-"DSL 是嵌入在 Rust 宏中的一种微型"语言"。它是完全有效的 Rust 代码,因为宏系统会将其展开为普通的 Rust 结构,"
-"但它看起来像一种小型语言。这使你能够为某些特定功能定义简洁或直观的语法(在一定范围内)。"
+"DSL 是嵌入在 Rust 宏中的一种微型\"语言\"。它是完全有效的 Rust 代码,因为宏系"
+"统会将其展开为普通的 Rust 结构,但它看起来像一种小型语言。这使你能够为某些特"
+"定功能定义简洁或直观的语法(在一定范围内)。"
#: src/macros/dsl.md:8
msgid ""
-"Suppose that I want to define a little calculator API. I would like to supply "
-"an expression and have the output printed to console."
+"Suppose that I want to define a little calculator API. I would like to "
+"supply an expression and have the output printed to console."
msgstr ""
-"假设我想定义一个简单的计算器 API。我希望提供一个表达式,并将计算结果打印到控制台。"
+"假设我想定义一个简单的计算器 API。我希望提供一个表达式,并将计算结果打印到控"
+"制台。"
#: src/macros/dsl.md:15
msgid "// Force types to be unsigned integers\n"
@@ -11143,14 +11543,17 @@
"developed, such as [`lazy_static`](https://crates.io/crates/lazy_static) or "
"[`clap`](https://crates.io/crates/clap)."
msgstr ""
-"这个例子非常简单,但已经有很多利用宏开发的复杂接口,比如 [`lazy_static`](https://crates.io/crates/lazy_static) 或 [`clap`](https://crates.io/crates/clap)。"
+"这个例子非常简单,但已经有很多利用宏开发的复杂接口,比如 [`lazy_static`]"
+"(https://crates.io/crates/lazy_static) 或 [`clap`](https://crates.io/crates/"
+"clap)。"
#: src/macros/dsl.md:43
msgid ""
"Also, note the two pairs of braces in the macro. The outer ones are part of "
"the syntax of `macro_rules!`, in addition to `()` or `[]`."
msgstr ""
-"另外,注意宏中的两对大括号。外层的大括号是 `macro_rules!` 语法的一部分,除此之外还可以使用 `()` 或 `[]`。"
+"另外,注意宏中的两对大括号。外层的大括号是 `macro_rules!` 语法的一部分,除此"
+"之外还可以使用 `()` 或 `[]`。"
#: src/macros/variadics.md:1
msgid "Variadic Interfaces"
@@ -11162,13 +11565,14 @@
"`println!` can take an arbitrary number of arguments, as determined by the "
"format string."
msgstr ""
-"**可变参数**接口可以接受任意数量的参数。例如,`println!` 可以接受任意数量的参数,这由格式字符串决定。"
+"**可变参数**接口可以接受任意数量的参数。例如,`println!` 可以接受任意数量的参"
+"数,这由格式字符串决定。"
#: src/macros/variadics.md:7
msgid ""
-"We can extend our `calculate!` macro from the previous section to be variadic:"
-msgstr ""
-"我们可以将上一节的 `calculate!` 宏扩展为可变参数的形式:"
+"We can extend our `calculate!` macro from the previous section to be "
+"variadic:"
+msgstr "我们可以将上一节的 `calculate!` 宏扩展为可变参数的形式:"
#: src/macros/variadics.md:11
msgid "// The pattern for a single `eval`\n"
@@ -11193,8 +11597,9 @@
"would clearly be problematic. Noticing and explicitly managing those errors "
"saves the rest of the program from various pitfalls."
msgstr ""
-"错误处理是处理可能出现失败情况的过程。例如,读取文件失败后继续使用那个**错误的**输入显然会导致问题。"
-"注意并明确管理这些错误可以使程序的其他部分避免各种陷阱。"
+"错误处理是处理可能出现失败情况的过程。例如,读取文件失败后继续使用那个**错误"
+"的**输入显然会导致问题。注意并明确管理这些错误可以使程序的其他部分避免各种陷"
+"阱。"
#: src/error.md:8
msgid ""
@@ -11202,32 +11607,34 @@
"the following subchapters. They all have more or less subtle differences and "
"different use cases. As a rule of thumb:"
msgstr ""
-"Rust 中有多种处理错误的方法,这些方法将在接下来的小节中详细介绍。它们或多或少都有一些细微的差别和不同的使用场景。"
-"一般来说:"
+"Rust 中有多种处理错误的方法,这些方法将在接下来的小节中详细介绍。它们或多或少"
+"都有一些细微的差别和不同的使用场景。一般来说:"
#: src/error.md:12
msgid ""
-"An explicit `panic` is mainly useful for tests and dealing with unrecoverable "
-"errors. For prototyping it can be useful, for example when dealing with "
-"functions that haven't been implemented yet, but in those cases the more "
-"descriptive `unimplemented` is better. In tests `panic` is a reasonable way "
-"to explicitly fail."
+"An explicit `panic` is mainly useful for tests and dealing with "
+"unrecoverable errors. For prototyping it can be useful, for example when "
+"dealing with functions that haven't been implemented yet, but in those cases "
+"the more descriptive `unimplemented` is better. In tests `panic` is a "
+"reasonable way to explicitly fail."
msgstr ""
-"显式的 `panic` 主要用于测试和处理不可恢复的错误。在原型开发中,它可能会有用,例如在处理尚未实现的函数时。"
-"但在这些情况下,使用更具描述性的 `unimplemented` 会更好。在测试中,`panic` 是一种合理的显式失败方式。"
+"显式的 `panic` 主要用于测试和处理不可恢复的错误。在原型开发中,它可能会有用,"
+"例如在处理尚未实现的函数时。但在这些情况下,使用更具描述性的 `unimplemented` "
+"会更好。在测试中,`panic` 是一种合理的显式失败方式。"
#: src/error.md:17
msgid ""
-"The `Option` type is for when a value is optional or when the lack of a value "
-"is not an error condition. For example the parent of a directory - `/` and `C:"
-"` don't have one. When dealing with `Option`s, `unwrap` is fine for "
+"The `Option` type is for when a value is optional or when the lack of a "
+"value is not an error condition. For example the parent of a directory - `/` "
+"and `C:` don't have one. When dealing with `Option`s, `unwrap` is fine for "
"prototyping and cases where it's absolutely certain that there is guaranteed "
"to be a value. However `expect` is more useful since it lets you specify an "
"error message in case something goes wrong anyway."
msgstr ""
-"`Option` 类型用于值是可选的情况,或者缺少值不构成错误条件的情况。例如目录的父目录 - `/` 和 `C:` 就没有父目录。"
-"在处理 `Option` 时,对于原型设计和绝对确定有值的情况,使用 `unwrap` 是可以的。然而,`expect` 更有用,"
-"因为它允许你指定一个错误消息,以防万一出错。"
+"`Option` 类型用于值是可选的情况,或者缺少值不构成错误条件的情况。例如目录的父"
+"目录 - `/` 和 `C:` 就没有父目录。在处理 `Option` 时,对于原型设计和绝对确定有"
+"值的情况,使用 `unwrap` 是可以的。然而,`expect` 更有用,因为它允许你指定一个"
+"错误消息,以防万一出错。"
#: src/error.md:24
msgid ""
@@ -11235,16 +11642,17 @@
"with the problem, use `Result`. You can `unwrap` and `expect` them as well "
"(please don't do that unless it's a test or quick prototype)."
msgstr ""
-"当有可能出错且调用者必须处理问题时,请使用 `Result`。你也可以对它们使用 `unwrap` 和 `expect`"
-"(除非是测试或快速原型,否则请不要这样做)。"
+"当有可能出错且调用者必须处理问题时,请使用 `Result`。你也可以对它们使用 "
+"`unwrap` 和 `expect`(除非是测试或快速原型,否则请不要这样做)。"
#: src/error.md:28
msgid ""
-"For a more rigorous discussion of error handling, refer to the error handling "
-"section in the [official book](https://doc.rust-lang.org/book/ch09-00-error-"
-"handling.html)."
+"For a more rigorous discussion of error handling, refer to the error "
+"handling section in the [official book](https://doc.rust-lang.org/book/"
+"ch09-00-error-handling.html)."
msgstr ""
-"关于错误处理更详尽的讨论,请参阅[官方文档](https://doc.rust-lang.org/book/ch09-00-error-handling.html)中的错误处理章节。"
+"关于错误处理更详尽的讨论,请参阅[官方文档](https://doc.rust-lang.org/book/"
+"ch09-00-error-handling.html)中的错误处理章节。"
#: src/error/panic.md:3
msgid ""
@@ -11252,16 +11660,16 @@
"error message, starts unwinding the stack, and usually exits the program. "
"Here, we explicitly call `panic` on our error condition:"
msgstr ""
-"我们将看到的最简单的错误处理机制是 `panic`。它会打印一条错误消息,开始展开栈,并通常会退出程序。"
-"在这里,我们在错误条件下显式调用 `panic`:"
+"我们将看到的最简单的错误处理机制是 `panic`。它会打印一条错误消息,开始展开"
+"栈,并通常会退出程序。在这里,我们在错误条件下显式调用 `panic`:"
-#: src/error/panic.md:9 src/error/abort_unwind.md:10
-msgid "// You shouldn't drink too much sugary beverages.\n"
+#: src/error/panic.md:9
+msgid "// You shouldn't drink too many sugary beverages.\n"
msgstr "// 你不应该喝太多含糖饮料。\n"
-#: src/error/panic.md:10 src/error/panic.md:17 src/error/abort_unwind.md:11
-#: src/error/abort_unwind.md:24 src/error/abort_unwind.md:42
-#: src/error/abort_unwind.md:51 src/error/option_unwrap.md:32
+#: src/error/panic.md:10 src/error/panic.md:17 src/error/abort_unwind.md:10
+#: src/error/abort_unwind.md:23 src/error/abort_unwind.md:41
+#: src/error/abort_unwind.md:50 src/error/option_unwrap.md:32
#: src/error/option_unwrap.md:43 src/error/option_unwrap.md:50
msgid "\"lemonade\""
msgstr "\"柠檬水\""
@@ -11270,13 +11678,13 @@
msgid "\"AAAaaaaa!!!!\""
msgstr "\"啊啊啊啊啊!!!!\""
-#: src/error/panic.md:12 src/error/abort_unwind.md:18
-#: src/error/abort_unwind.md:45
+#: src/error/panic.md:12 src/error/abort_unwind.md:17
+#: src/error/abort_unwind.md:44
msgid "\"Some refreshing {} is all I need.\""
msgstr "\"来点清爽的{}就是我现在需要的。\""
-#: src/error/panic.md:16 src/error/abort_unwind.md:23
-#: src/error/abort_unwind.md:50 src/error/option_unwrap.md:49
+#: src/error/panic.md:16 src/error/abort_unwind.md:22
+#: src/error/abort_unwind.md:49 src/error/option_unwrap.md:49
msgid "\"water\""
msgstr "\"水\""
@@ -11288,7 +11696,9 @@
msgid ""
"The first call to `drink` works. The second panics and thus the third is "
"never called."
-msgstr "第一次调用 `drink` 正常执行。第二次调用会引发 panic,因此第三次调用永远不会被执行。"
+msgstr ""
+"第一次调用 `drink` 正常执行。第二次调用会引发 panic,因此第三次调用永远不会被"
+"执行。"
#: src/error/abort_unwind.md:1
msgid "`abort` and `unwind`"
@@ -11299,37 +11709,44 @@
"The previous section illustrates the error handling mechanism `panic`. "
"Different code paths can be conditionally compiled based on the panic "
"setting. The current values available are `unwind` and `abort`."
-msgstr "上一节介绍了错误处理机制 `panic`。可以根据 panic 设置有条件地编译不同的代码路径。当前可用的值有 `unwind` 和 `abort`。"
+msgstr ""
+"上一节介绍了错误处理机制 `panic`。可以根据 panic 设置有条件地编译不同的代码路"
+"径。当前可用的值有 `unwind` 和 `abort`。"
-#: src/error/abort_unwind.md:6
+#: src/error/abort_unwind.md:5
msgid ""
"Building on the prior lemonade example, we explicitly use the panic strategy "
"to exercise different lines of code."
msgstr "基于之前的柠檬水示例,我们明确使用 panic 策略来执行不同的代码行。"
-#: src/error/abort_unwind.md:12
+#: src/error/abort_unwind.md:9
+msgid "// You shouldn't drink too much sugary beverages.\n"
+msgstr "// 你不应该喝太多含糖饮料。\n"
+
+#: src/error/abort_unwind.md:11
msgid "\"abort\""
msgstr "\"中止\""
-#: src/error/abort_unwind.md:13 src/error/abort_unwind.md:38
+#: src/error/abort_unwind.md:12 src/error/abort_unwind.md:37
msgid "\"This is not your party. Run!!!!\""
msgstr "\"这不是你的派对。快跑!!!!\""
-#: src/error/abort_unwind.md:15 src/error/abort_unwind.md:33
+#: src/error/abort_unwind.md:14 src/error/abort_unwind.md:32
msgid "\"Spit it out!!!!\""
msgstr "\"快吐出来!!!!\""
-#: src/error/abort_unwind.md:28
+#: src/error/abort_unwind.md:27
msgid ""
"Here is another example focusing on rewriting `drink()` and explicitly use "
"the `unwind` keyword."
-msgstr "这里是另一个示例,重点是重写 `drink()` 函数并明确使用 `unwind` 关键字。"
+msgstr ""
+"这里是另一个示例,重点是重写 `drink()` 函数并明确使用 `unwind` 关键字。"
-#: src/error/abort_unwind.md:31 src/error/abort_unwind.md:36
+#: src/error/abort_unwind.md:30 src/error/abort_unwind.md:35
msgid "\"unwind\""
msgstr "\"unwind\""
-#: src/error/abort_unwind.md:55
+#: src/error/abort_unwind.md:54
msgid ""
"The panic strategy can be set from the command line by using `abort` or "
"`unwind`."
@@ -11337,24 +11754,31 @@
#: src/error/option_unwrap.md:3
msgid ""
-"In the last example, we showed that we can induce program failure at will. We "
-"told our program to `panic` if we drink a sugary lemonade. But what if we "
-"expect _some_ drink but don't receive one? That case would be just as bad, so "
-"it needs to be handled!"
-msgstr "在上一个例子中,我们展示了如何主动引发程序失败。我们让程序在喝含糖柠檬水时触发 `panic`。但如果我们期望得到**某种**饮料却没有收到呢?这种情况同样糟糕,所以需要处理!"
+"In the last example, we showed that we can induce program failure at will. "
+"We told our program to `panic` if we drink a sugary lemonade. But what if we "
+"expect _some_ drink but don't receive one? That case would be just as bad, "
+"so it needs to be handled!"
+msgstr ""
+"在上一个例子中,我们展示了如何主动引发程序失败。我们让程序在喝含糖柠檬水时触"
+"发 `panic`。但如果我们期望得到**某种**饮料却没有收到呢?这种情况同样糟糕,所"
+"以需要处理!"
#: src/error/option_unwrap.md:8
msgid ""
"We _could_ test this against the null string (`\"\"`) as we do with a "
"lemonade. Since we're using Rust, let's instead have the compiler point out "
"cases where there's no drink."
-msgstr "我们**可以**像处理柠檬水那样对空字符串(`\"\"`)进行测试。但既然我们使用的是 Rust,不如让编译器指出没有饮料的情况。"
+msgstr ""
+"我们**可以**像处理柠檬水那样对空字符串(`\"\"`)进行测试。但既然我们使用的是 "
+"Rust,不如让编译器指出没有饮料的情况。"
#: src/error/option_unwrap.md:12
msgid ""
"An `enum` called `Option<T>` in the `std` library is used when absence is a "
"possibility. It manifests itself as one of two \"options\":"
-msgstr "`std` 库中的 `Option<T>` 枚举用于处理可能存在缺失的情况。它表现为两个"选项"之一:"
+msgstr ""
+"`std` 库中的 `Option<T>` 枚举用于处理可能存在缺失的情况。它表现为两个\"选项"
+"\"之一:"
#: src/error/option_unwrap.md:15
msgid "`Some(T)`: An element of type `T` was found"
@@ -11368,7 +11792,9 @@
msgid ""
"These cases can either be explicitly handled via `match` or implicitly with "
"`unwrap`. Implicit handling will either return the inner element or `panic`."
-msgstr "这些情况可以通过 `match` 显式处理,也可以用 `unwrap` 隐式处理。隐式处理要么返回内部元素,要么触发 `panic`。"
+msgstr ""
+"这些情况可以通过 `match` 显式处理,也可以用 `unwrap` 隐式处理。隐式处理要么返"
+"回内部元素,要么触发 `panic`。"
#: src/error/option_unwrap.md:21
msgid ""
@@ -11377,7 +11803,11 @@
"otherwise leaves us with a less meaningful output than explicit handling. In "
"the following example, explicit handling yields a more controlled result "
"while retaining the option to `panic` if desired."
-msgstr "注意,可以使用 [`expect`](https://doc.rust-lang.org/std/option/enum.Option.html#method.expect) 手动自定义 `panic`,但 `unwrap` 相比显式处理会产生一个不太有意义的输出。在下面的例子中,显式处理产生了一个更可控的结果,同时保留了在需要时触发 `panic` 的选项。"
+msgstr ""
+"注意,可以使用 [`expect`](https://doc.rust-lang.org/std/option/"
+"enum.Option.html#method.expect) 手动自定义 `panic`,但 `unwrap` 相比显式处理"
+"会产生一个不太有意义的输出。在下面的例子中,显式处理产生了一个更可控的结果,"
+"同时保留了在需要时触发 `panic` 的选项。"
#: src/error/option_unwrap.md:27
msgid ""
@@ -11429,16 +11859,19 @@
"to use the `?` operator. If `x` is an `Option`, then evaluating `x?` will "
"return the underlying value if `x` is `Some`, otherwise it will terminate "
"whatever function is being executed and return `None`."
-msgstr "你可以使用 `match` 语句来解包 `Option`,但使用 `?` 运算符通常更简便。如果 `x` 是一个 `Option`,那么求值 `x?` 将在 `x` 是 `Some` 时返回其内部值,否则它将终止当前执行的函数并返回 `None`。"
+msgstr ""
+"你可以使用 `match` 语句来解包 `Option`,但使用 `?` 运算符通常更简便。如果 "
+"`x` 是一个 `Option`,那么求值 `x?` 将在 `x` 是 `Some` 时返回其内部值,否则它"
+"将终止当前执行的函数并返回 `None`。"
#: src/error/option_unwrap/question_mark.md:10
msgid ""
"// If `current_age` is `None`, this returns `None`.\n"
-"\t// If `current_age` is `Some`, the inner `u8` value + 1\n"
+" // If `current_age` is `Some`, the inner `u8` value + 1\n"
" // gets assigned to `next_age`\n"
msgstr ""
"// 如果 `current_age` 是 `None`,这将返回 `None`。\n"
-"\t// 如果 `current_age` 是 `Some`,内部的 `u8` 值加 1\n"
+" // 如果 `current_age` 是 `Some`,内部的 `u8` 值加 1\n"
" // 后被赋值给 `next_age`\n"
#: src/error/option_unwrap/question_mark.md:14
@@ -11451,7 +11884,8 @@
#: src/error/option_unwrap/question_mark.md:38
msgid ""
-"// Gets the area code of the phone number of the person's job, if it exists.\n"
+"// Gets the area code of the phone number of the person's job, if it "
+"exists.\n"
msgstr "// 如果存在,获取此人工作电话号码的区号。\n"
#: src/error/option_unwrap/question_mark.md:40
@@ -11467,16 +11901,15 @@
#: src/error/option_unwrap/map.md:3
msgid ""
-"`match` is a valid method for handling `Option`s. However, you may eventually "
-"find heavy usage tedious, especially with operations only valid with an "
-"input. In these cases, [combinators](https://doc.rust-lang.org/reference/"
-"glossary.html#combinator) can be used to manage control flow in a modular "
-"fashion."
+"`match` is a valid method for handling `Option`s. However, you may "
+"eventually find heavy usage tedious, especially with operations only valid "
+"with an input. In these cases, [combinators](https://doc.rust-lang.org/"
+"reference/glossary.html#combinator) can be used to manage control flow in a "
+"modular fashion."
msgstr ""
-"`match` 是处理 `Option` 的有效方法。然而,频繁使用可能会让人感到繁琐,"
-"尤其是在只有输入时才有效的操作中。在这些情况下,可以使用"
-"[组合器](https://doc.rust-lang.org/reference/glossary.html#combinator)"
-"以模块化的方式管理控制流。"
+"`match` 是处理 `Option` 的有效方法。然而,频繁使用可能会让人感到繁琐,尤其是"
+"在只有输入时才有效的操作中。在这些情况下,可以使用[组合器](https://doc.rust-"
+"lang.org/reference/glossary.html#combinator)以模块化的方式管理控制流。"
#: src/error/option_unwrap/map.md:8
msgid ""
@@ -11485,14 +11918,14 @@
"chained together for even more flexibility."
msgstr ""
"`Option` 有一个内置方法 `map()`,这是一个用于简单映射 `Some -> Some` 和 "
-"`None -> None` 的组合器。多个 `map()` 调用可以链式使用,从而提供更大的灵活性。"
+"`None -> None` 的组合器。多个 `map()` 调用可以链式使用,从而提供更大的灵活"
+"性。"
#: src/error/option_unwrap/map.md:12
msgid ""
"In the following example, `process()` replaces all functions previous to it "
"while staying compact."
-msgstr ""
-"在下面的例子中,`process()` 函数以简洁的方式替代了之前的所有函数。"
+msgstr "在下面的例子中,`process()` 函数以简洁的方式替代了之前的所有函数。"
#: src/error/option_unwrap/map.md:23
msgid ""
@@ -11560,9 +11993,9 @@
"in some languages as flatmap, comes in."
msgstr ""
"`map()` 被描述为一种可链式调用的方式来简化 `match` 语句。然而,在返回 "
-"`Option<T>` 的函数上使用 `map()` 会导致嵌套的 `Option<Option<T>>`。链式调用"
-"多个这样的函数可能会变得令人困惑。这时,另一个称为 `and_then()` 的组合器"
-"(在某些语言中称为 flatmap)就派上用场了。"
+"`Option<T>` 的函数上使用 `map()` 会导致嵌套的 `Option<Option<T>>`。链式调用多"
+"个这样的函数可能会变得令人困惑。这时,另一个称为 `and_then()` 的组合器(在某"
+"些语言中称为 flatmap)就派上用场了。"
#: src/error/option_unwrap/and_then.md:9
msgid ""
@@ -11574,13 +12007,13 @@
#: src/error/option_unwrap/and_then.md:11
msgid ""
-"In the following example, `cookable_v3()` results in an `Option<Food>`. Using "
-"`map()` instead of `and_then()` would have given an `Option<Option<Food>>`, "
-"which is an invalid type for `eat()`."
+"In the following example, `cookable_v3()` results in an `Option<Food>`. "
+"Using `map()` instead of `and_then()` would have given an "
+"`Option<Option<Food>>`, which is an invalid type for `eat()`."
msgstr ""
-"在下面的例子中,`cookable_v3()` 返回一个 `Option<Food>`。如果使用 `map()` "
-"而不是 `and_then()`,将会得到一个 `Option<Option<Food>>`,这对于 `eat()` "
-"函数来说是一个无效的类型。"
+"在下面的例子中,`cookable_v3()` 返回一个 `Option<Food>`。如果使用 `map()` 而"
+"不是 `and_then()`,将会得到一个 `Option<Option<Food>>`,这对于 `eat()` 函数来"
+"说是一个无效的类型。"
#: src/error/option_unwrap/and_then.md:20
msgid "// We don't have the ingredients to make Sushi.\n"
@@ -11641,76 +12074,80 @@
"if it is `None`. To choose the one that meets our needs, we need to consider "
"the following:"
msgstr ""
-"有多种方法可以解包 `Option` 并在其为 `None` 时使用默认值。为了选择满足我们"
-"需求的方法,我们需要考虑以下几点:"
+"有多种方法可以解包 `Option` 并在其为 `None` 时使用默认值。为了选择满足我们需"
+"求的方法,我们需要考虑以下几点:"
-#: src/error/option_unwrap/defaults.md:4
+#: src/error/option_unwrap/defaults.md:5
msgid "do we need eager or lazy evaluation?"
msgstr "我们需要立即求值还是惰性求值?"
-#: src/error/option_unwrap/defaults.md:5
+#: src/error/option_unwrap/defaults.md:6
msgid ""
"do we need to keep the original empty value intact, or modify it in place?"
msgstr "我们需要保持原始的空值不变,还是就地修改它?"
-#: src/error/option_unwrap/defaults.md:7
+#: src/error/option_unwrap/defaults.md:8
msgid "`or()` is chainable, evaluates eagerly, keeps empty value intact"
msgstr "`or()` 可链式调用,立即求值,保持空值不变"
-#: src/error/option_unwrap/defaults.md:9
+#: src/error/option_unwrap/defaults.md:10
msgid ""
"`or()`is chainable and eagerly evaluates its argument, as is shown in the "
"following example. Note that because `or`'s arguments are evaluated eagerly, "
"the variable passed to `or` is moved."
msgstr ""
-"`or()` 可以链式调用,并且会立即求值其参数,如下例所示。注意,由于 `or` 的"
-"参数是立即求值的,传递给 `or` 的变量会被移动。"
+"`or()` 可以链式调用,并且会立即求值其参数,如下例所示。注意,由于 `or` 的参数"
+"是立即求值的,传递给 `or` 的变量会被移动。"
-#: src/error/option_unwrap/defaults.md:21 src/error/option_unwrap/defaults.md:54
+#: src/error/option_unwrap/defaults.md:22
+#: src/error/option_unwrap/defaults.md:55
msgid "\"first_available_fruit: {:?}\""
msgstr "\"第一个可用的水果:{:?}\""
-#: src/error/option_unwrap/defaults.md:22
+#: src/error/option_unwrap/defaults.md:23
msgid "// first_available_fruit: Some(Orange)\n"
msgstr "// first_available_fruit: Some(Orange)\n"
-#: src/error/option_unwrap/defaults.md:24
+#: src/error/option_unwrap/defaults.md:25
msgid ""
"// `or` moves its argument.\n"
" // In the example above, `or(orange)` returned a `Some`, so `or(apple)` "
"was not invoked.\n"
" // But the variable named `apple` has been moved regardless, and cannot "
"be used anymore.\n"
-" // println!(\"Variable apple was moved, so this line won't compile: "
-"{:?}\", apple);\n"
+" // println!(\"Variable apple was moved, so this line won't compile: {:?}"
+"\", apple);\n"
" // TODO: uncomment the line above to see the compiler error\n"
msgstr ""
"// `or` 会移动其参数。\n"
-" // 在上面的例子中,`or(orange)` 返回了 `Some`,所以 `or(apple)` 没有被调用。\n"
+" // 在上面的例子中,`or(orange)` 返回了 `Some`,所以 `or(apple)` 没有被调"
+"用。\n"
" // 但是名为 `apple` 的变量无论如何都被移动了,不能再使用。\n"
" // println!(\"变量 apple 被移动了,所以这行不会编译:{:?}\", apple);\n"
" // TODO:取消上面这行的注释来查看编译器错误\n"
-#: src/error/option_unwrap/defaults.md:32
+#: src/error/option_unwrap/defaults.md:33
msgid "`or_else()` is chainable, evaluates lazily, keeps empty value intact"
msgstr "`or_else()` 可以链式调用,惰性求值,保持空值不变"
-#: src/error/option_unwrap/defaults.md:34
+#: src/error/option_unwrap/defaults.md:35
msgid ""
"Another alternative is to use `or_else`, which is also chainable, and "
"evaluates lazily, as is shown in the following example:"
msgstr ""
-"另一种选择是使用 `or_else`,它同样支持链式调用,并且采用惰性求值。以下是一个示例:"
+"另一种选择是使用 `or_else`,它同样支持链式调用,并且采用惰性求值。以下是一个"
+"示例:"
-#: src/error/option_unwrap/defaults.md:43
+#: src/error/option_unwrap/defaults.md:44
msgid "\"Providing kiwi as fallback\""
msgstr "\"提供猕猴桃作为备选\""
-#: src/error/option_unwrap/defaults.md:47 src/error/option_unwrap/defaults.md:91
+#: src/error/option_unwrap/defaults.md:48
+#: src/error/option_unwrap/defaults.md:93
msgid "\"Providing lemon as fallback\""
msgstr "\"提供柠檬作为备选\""
-#: src/error/option_unwrap/defaults.md:55
+#: src/error/option_unwrap/defaults.md:56
msgid ""
"// Providing kiwi as fallback\n"
" // first_available_fruit: Some(Kiwi)\n"
@@ -11718,29 +12155,32 @@
"// 提供猕猴桃作为备选\n"
" // first_available_fruit: Some(Kiwi)\n"
-#: src/error/option_unwrap/defaults.md:60
+#: src/error/option_unwrap/defaults.md:61
msgid "`get_or_insert()` evaluates eagerly, modifies empty value in place"
msgstr "`get_or_insert()` 立即求值,原地修改空值"
-#: src/error/option_unwrap/defaults.md:62
+#: src/error/option_unwrap/defaults.md:63
msgid ""
-"To make sure that an `Option` contains a value, we can use `get_or_insert` to "
-"modify it in place with a fallback value, as is shown in the following "
+"To make sure that an `Option` contains a value, we can use `get_or_insert` "
+"to modify it in place with a fallback value, as is shown in the following "
"example. Note that `get_or_insert` eagerly evaluates its parameter, so "
"variable `apple` is moved:"
msgstr ""
-"为确保 `Option` 包含一个值,我们可以使用 `get_or_insert` 来原地修改它,提供一个备选值。"
-"下面的例子展示了这一点。请注意,`get_or_insert` 会立即求值其参数,因此变量 `apple` 会被移动:"
+"为确保 `Option` 包含一个值,我们可以使用 `get_or_insert` 来原地修改它,提供一"
+"个备选值。下面的例子展示了这一点。请注意,`get_or_insert` 会立即求值其参数,"
+"因此变量 `apple` 会被移动:"
-#: src/error/option_unwrap/defaults.md:72 src/error/option_unwrap/defaults.md:96
+#: src/error/option_unwrap/defaults.md:73
+#: src/error/option_unwrap/defaults.md:98
msgid "\"first_available_fruit is: {:?}\""
msgstr "\"第一个可用的水果是:{:?}\""
-#: src/error/option_unwrap/defaults.md:73 src/error/option_unwrap/defaults.md:97
+#: src/error/option_unwrap/defaults.md:74
+#: src/error/option_unwrap/defaults.md:99
msgid "\"my_fruit is: {:?}\""
msgstr "\"我的水果是:{:?}\""
-#: src/error/option_unwrap/defaults.md:74
+#: src/error/option_unwrap/defaults.md:75
msgid ""
"// first_available_fruit is: Apple\n"
" // my_fruit is: Some(Apple)\n"
@@ -11752,18 +12192,19 @@
" //println!(\"名为 `apple` 的变量已被移动:{:?}\", apple);\n"
" // TODO:取消上面这行的注释以查看编译器错误\n"
-#: src/error/option_unwrap/defaults.md:81
+#: src/error/option_unwrap/defaults.md:82
msgid "`get_or_insert_with()` evaluates lazily, modifies empty value in place"
msgstr "`get_or_insert_with()` 惰性求值,原地修改空值"
-#: src/error/option_unwrap/defaults.md:83
+#: src/error/option_unwrap/defaults.md:84
msgid ""
"Instead of explicitly providing a value to fall back on, we can pass a "
"closure to `get_or_insert_with`, as follows:"
msgstr ""
-"我们可以向 `get_or_insert_with` 传递一个闭包,而不是显式提供一个备选值。示例如下:"
+"我们可以向 `get_or_insert_with` 传递一个闭包,而不是显式提供一个备选值。示例"
+"如下:"
-#: src/error/option_unwrap/defaults.md:98
+#: src/error/option_unwrap/defaults.md:100
msgid ""
"// Providing lemon as fallback\n"
" // first_available_fruit is: Lemon\n"
@@ -11773,21 +12214,21 @@
" // first_available_fruit is: Lemon\n"
" // my_fruit is: Some(Lemon)\n"
-#: src/error/option_unwrap/defaults.md:102
+#: src/error/option_unwrap/defaults.md:104
msgid ""
"// If the Option has a value, it is left unchanged, and the closure is not "
"invoked\n"
msgstr "// 如果 Option 已有值,它将保持不变,闭包不会被调用\n"
-#: src/error/option_unwrap/defaults.md:105
+#: src/error/option_unwrap/defaults.md:107
msgid "\"should_be_apple is: {:?}\""
msgstr "\"should_be_apple 的值为:{:?}\""
-#: src/error/option_unwrap/defaults.md:106
+#: src/error/option_unwrap/defaults.md:108
msgid "\"my_apple is unchanged: {:?}\""
msgstr "\"my_apple 保持不变:{:?}\""
-#: src/error/option_unwrap/defaults.md:107
+#: src/error/option_unwrap/defaults.md:109
msgid ""
"// The output is a follows. Note that the closure `get_lemon_as_fallback` is "
"not invoked\n"
@@ -11798,34 +12239,36 @@
" // should_be_apple is: Apple\n"
" // my_apple is unchanged: Some(Apple)\n"
-#: src/error/option_unwrap/defaults.md:115
+#: src/error/option_unwrap/defaults.md:117
msgid ""
"[`closures`](https://doc.rust-lang.org/book/ch13-01-closures.html), "
-"[`get_or_insert`](https://doc.rust-lang.org/core/option/enum.Option."
-"html#method.get_or_insert), [`get_or_insert_with`](https://doc.rust-lang.org/"
-"core/option/enum.Option.html#method.get_or_insert_with), [`moved variables`]"
-"(https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html), [`or`]"
-"(https://doc.rust-lang.org/core/option/enum.Option.html#method.or), "
-"[`or_else`](https://doc.rust-lang.org/core/option/enum.Option.html#method."
-"or_else)"
+"[`get_or_insert`](https://doc.rust-lang.org/core/option/"
+"enum.Option.html#method.get_or_insert), [`get_or_insert_with`](https://"
+"doc.rust-lang.org/core/option/enum.Option.html#method.get_or_insert_with), "
+"[`moved variables`](https://doc.rust-lang.org/book/ch04-02-references-and-"
+"borrowing.html), [`or`](https://doc.rust-lang.org/core/option/"
+"enum.Option.html#method.or), [`or_else`](https://doc.rust-lang.org/core/"
+"option/enum.Option.html#method.or_else)"
msgstr ""
"[`闭包`](https://doc.rust-lang.org/book/ch13-01-closures.html)、"
-"[`get_or_insert`](https://doc.rust-lang.org/core/option/enum.Option."
-"html#method.get_or_insert)、[`get_or_insert_with`](https://doc.rust-lang.org/"
-"core/option/enum.Option.html#method.get_or_insert_with)、[`变量移动`]"
-"(https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html)、[`or`]"
-"(https://doc.rust-lang.org/core/option/enum.Option.html#method.or)、"
-"[`or_else`](https://doc.rust-lang.org/core/option/enum.Option.html#method."
-"or_else)"
+"[`get_or_insert`](https://doc.rust-lang.org/core/option/"
+"enum.Option.html#method.get_or_insert)、[`get_or_insert_with`](https://"
+"doc.rust-lang.org/core/option/enum.Option.html#method.get_or_insert_with)、[`"
+"变量移动`](https://doc.rust-lang.org/book/ch04-02-references-and-"
+"borrowing.html)、[`or`](https://doc.rust-lang.org/core/option/"
+"enum.Option.html#method.or)、[`or_else`](https://doc.rust-lang.org/core/"
+"option/enum.Option.html#method.or_else)"
#: src/error/result.md:3
msgid ""
-"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) is a richer "
-"version of the [`Option`](https://doc.rust-lang.org/std/option/enum.Option."
-"html) type that describes possible _error_ instead of possible _absence_."
+"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) is a "
+"richer version of the [`Option`](https://doc.rust-lang.org/std/option/"
+"enum.Option.html) type that describes possible _error_ instead of possible "
+"_absence_."
msgstr ""
-"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) 是 [`Option`](https://doc.rust-lang.org/std/option/enum.Option."
-"html) 类型的增强版,它描述可能的**错误**而非可能的**缺失**。"
+"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) 是 "
+"[`Option`](https://doc.rust-lang.org/std/option/enum.Option.html) 类型的增强"
+"版,它描述可能的**错误**而非可能的**缺失**。"
#: src/error/result.md:6
msgid "That is, `Result<T, E>` could have one of two outcomes:"
@@ -11851,8 +12294,9 @@
"example, either yields the element `T` or `panic`s. For case handling, there "
"are many combinators between `Result` and `Option` that overlap."
msgstr ""
-"与 `Option` 类似,`Result` 也有许多关联方法。例如,`unwrap()` 要么返回元素 `T`,要么触发 `panic`。"
-"对于情况处理,`Result` 和 `Option` 之间有许多重叠的组合子。"
+"与 `Option` 类似,`Result` 也有许多关联方法。例如,`unwrap()` 要么返回元素 "
+"`T`,要么触发 `panic`。对于情况处理,`Result` 和 `Option` 之间有许多重叠的组"
+"合子。"
#: src/error/result.md:17
msgid ""
@@ -11862,9 +12306,10 @@
"parse a string into the other type, so `parse()` returns a `Result` "
"indicating possible failure."
msgstr ""
-"在使用 Rust 时,你可能会遇到返回 `Result` 类型的方法,比如 [`parse()`](https://doc.rust-lang.org/std/"
-"primitive.str.html#method.parse) 方法。将字符串解析为其他类型并非总是可行,因此 `parse()` 返回一个 `Result` "
-"来表示可能的失败。"
+"在使用 Rust 时,你可能会遇到返回 `Result` 类型的方法,比如 [`parse()`]"
+"(https://doc.rust-lang.org/std/primitive.str.html#method.parse) 方法。将字符"
+"串解析为其他类型并非总是可行,因此 `parse()` 返回一个 `Result` 来表示可能的失"
+"败。"
#: src/error/result.md:22
msgid ""
@@ -11902,17 +12347,17 @@
#: src/error/result.md:41
msgid ""
-"In the unsuccessful case, `parse()` leaves us with an error for `unwrap()` to "
-"`panic` on. Additionally, the `panic` exits our program and provides an "
+"In the unsuccessful case, `parse()` leaves us with an error for `unwrap()` "
+"to `panic` on. Additionally, the `panic` exits our program and provides an "
"unpleasant error message."
msgstr ""
-"在解析失败的情况下,`parse()` 会返回一个错误,导致 `unwrap()` 触发 panic。"
-"此外,panic 会终止程序并输出一条不友好的错误信息。"
+"在解析失败的情况下,`parse()` 会返回一个错误,导致 `unwrap()` 触发 panic。此"
+"外,panic 会终止程序并输出一条不友好的错误信息。"
#: src/error/result.md:45
msgid ""
-"To improve the quality of our error message, we should be more specific about "
-"the return type and consider explicitly handling the error."
+"To improve the quality of our error message, we should be more specific "
+"about the return type and consider explicitly handling the error."
msgstr ""
"为了提高错误信息的质量,我们应该更明确地指定返回类型,并考虑显式地处理错误。"
@@ -11925,33 +12370,33 @@
"The `Result` type can also be the return type of the `main` function if "
"specified explicitly. Typically the `main` function will be of the form:"
msgstr ""
-"如果显式指定,`Result` 类型也可以作为 `main` 函数的返回类型。"
-"通常,`main` 函数的形式如下:"
+"如果显式指定,`Result` 类型也可以作为 `main` 函数的返回类型。通常,`main` 函"
+"数的形式如下:"
#: src/error/result.md:59
msgid ""
"However `main` is also able to have a return type of `Result`. If an error "
"occurs within the `main` function it will return an error code and print a "
-"debug representation of the error (using the [`Debug`](https://doc.rust-lang."
-"org/std/fmt/trait.Debug.html) trait). The following example shows such a "
-"scenario and touches on aspects covered in [the following section](result/"
+"debug representation of the error (using the [`Debug`](https://doc.rust-"
+"lang.org/std/fmt/trait.Debug.html) trait). The following example shows such "
+"a scenario and touches on aspects covered in [the following section](result/"
"early_returns.md)."
msgstr ""
-"然而,`main` 函数也可以返回 `Result` 类型。如果 `main` 函数内发生错误,"
-"它将返回一个错误代码并打印该错误的调试表示(使用 [`Debug`] trait)。"
-"以下示例展示了这种情况,并涉及了[下一节]中讨论的内容。\n"
+"然而,`main` 函数也可以返回 `Result` 类型。如果 `main` 函数内发生错误,它将返"
+"回一个错误代码并打印该错误的调试表示(使用 [`Debug`] trait)。以下示例展示了"
+"这种情况,并涉及了[下一节]中讨论的内容。\n"
"\n"
"[`Debug`]: https://doc.rust-lang.org/std/fmt/trait.Debug.html\n"
"[下一节]: result/early_returns.md"
#: src/error/result/result_map.md:3
msgid ""
-"Panicking in the previous example's `multiply` does not make for robust code. "
-"Generally, we want to return the error to the caller so it can decide what is "
-"the right way to respond to errors."
+"Panicking in the previous example's `multiply` does not make for robust "
+"code. Generally, we want to return the error to the caller so it can decide "
+"what is the right way to respond to errors."
msgstr ""
-"在前面示例的 `multiply` 函数中使用 panic 并不能产生健壮的代码。"
-"通常,我们希望将错误返回给调用者,让它决定如何正确地处理错误。"
+"在前面示例的 `multiply` 函数中使用 panic 并不能产生健壮的代码。通常,我们希望"
+"将错误返回给调用者,让它决定如何正确地处理错误。"
#: src/error/result/result_map.md:7
msgid ""
@@ -11963,27 +12408,27 @@
"`Err` type is specified as [`ParseIntError`](https://doc.rust-lang.org/std/"
"num/struct.ParseIntError.html)."
msgstr ""
-"首先,我们需要知道我们正在处理的错误类型。要确定 `Err` 类型,我们可以查看 [`parse()`] 方法,"
-"它是通过 [`FromStr`] trait 为 [`i32`] 实现的。因此,`Err` 类型被指定为 [`ParseIntError`]。\n"
+"首先,我们需要知道我们正在处理的错误类型。要确定 `Err` 类型,我们可以查看 "
+"[`parse()`] 方法,它是通过 [`FromStr`] trait 为 [`i32`] 实现的。因此,`Err` "
+"类型被指定为 [`ParseIntError`]。\n"
"\n"
"[`parse()`]: https://doc.rust-lang.org/std/primitive.str.html#method.parse\n"
"[`FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html\n"
"[`i32`]: https://doc.rust-lang.org/std/primitive.i32.html\n"
-"[`ParseIntError`]: https://doc.rust-lang.org/std/num/struct.ParseIntError.html"
+"[`ParseIntError`]: https://doc.rust-lang.org/std/num/"
+"struct.ParseIntError.html"
#: src/error/result/result_map.md:12
msgid ""
"In the example below, the straightforward `match` statement leads to code "
"that is overall more cumbersome."
-msgstr ""
-"在下面的示例中,直接使用 `match` 语句会导致整体代码更加繁琐。"
+msgstr "在下面的示例中,直接使用 `match` 语句会导致整体代码更加繁琐。"
#: src/error/result/result_map.md:17
msgid ""
"// With the return type rewritten, we use pattern matching without "
"`unwrap()`.\n"
-msgstr ""
-"// 重写返回类型后,我们使用模式匹配而不是 `unwrap()`。\n"
+msgstr "// 重写返回类型后,我们使用模式匹配而不是 `unwrap()`。\n"
#: src/error/result/result_map.md:35 src/error/result/result_map.md:68
#: src/error/result/result_alias.md:30 src/error/result/early_returns.md:30
@@ -12017,8 +12462,9 @@
"implemented for `Result`. [`Result`](https://doc.rust-lang.org/std/result/"
"enum.Result.html) contains a complete listing."
msgstr ""
-"幸运的是,`Option` 的 `map`、`and_then` 以及许多其他组合器也为 `Result` 实现了。"
-"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) 文档中包含了完整的列表。"
+"幸运的是,`Option` 的 `map`、`and_then` 以及许多其他组合器也为 `Result` 实现"
+"了。[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) 文档中"
+"包含了完整的列表。"
#: src/error/result/result_map.md:56
msgid ""
@@ -12038,19 +12484,21 @@
"we can define one for the specific `Result` in question."
msgstr ""
"如果我们想多次重用特定的 `Result` 类型,该怎么办?回想一下,Rust 允许我们创建"
-"[别名](../../types/alias.md)。方便的是,我们可以为特定的 `Result` 定义一个别名。"
+"[别名](../../types/alias.md)。方便的是,我们可以为特定的 `Result` 定义一个别"
+"名。"
#: src/error/result/result_alias.md:7
msgid ""
-"At a module level, creating aliases can be particularly helpful. Errors found "
-"in a specific module often have the same `Err` type, so a single alias can "
-"succinctly define _all_ associated `Results`. This is so useful that the "
-"`std` library even supplies one: [`io::Result`](https://doc.rust-lang.org/std/"
-"io/type.Result.html)!"
+"At a module level, creating aliases can be particularly helpful. Errors "
+"found in a specific module often have the same `Err` type, so a single alias "
+"can succinctly define _all_ associated `Results`. This is so useful that the "
+"`std` library even supplies one: [`io::Result`](https://doc.rust-lang.org/"
+"std/io/type.Result.html)!"
msgstr ""
-"在模块级别,创建别名特别有用。在特定模块中发现的错误通常具有相同的 `Err` 类型,"
-"因此单个别名可以简洁地定义**所有**相关的 `Result`。这非常实用,以至于 `std` 库"
-"甚至提供了一个:[`io::Result`](https://doc.rust-lang.org/std/io/type.Result.html)!"
+"在模块级别,创建别名特别有用。在特定模块中发现的错误通常具有相同的 `Err` 类"
+"型,因此单个别名可以简洁地定义**所有**相关的 `Result`。这非常实用,以至于 "
+"`std` 库甚至提供了一个:[`io::Result`](https://doc.rust-lang.org/std/io/"
+"type.Result.html)!"
#: src/error/result/result_alias.md:12
msgid "Here's a quick example to show off the syntax:"
@@ -12060,8 +12508,7 @@
msgid ""
"// Define a generic alias for a `Result` with the error type "
"`ParseIntError`.\n"
-msgstr ""
-"// 为错误类型为 `ParseIntError` 的 `Result` 定义一个泛型别名。\n"
+msgstr "// 为错误类型为 `ParseIntError` 的 `Result` 定义一个泛型别名。\n"
#: src/error/result/result_alias.md:19
msgid "// Use the above alias to refer to our specific `Result` type.\n"
@@ -12081,17 +12528,19 @@
"Another way to deal with this case analysis is to use a combination of "
"`match` statements and _early returns_."
msgstr ""
-"在前面的例子中,我们使用组合器显式地处理了错误。处理这种情况分析的另一种方法是"
-"使用 `match` 语句和**提前返回**的组合。"
+"在前面的例子中,我们使用组合器显式地处理了错误。处理这种情况分析的另一种方法"
+"是使用 `match` 语句和**提前返回**的组合。"
#: src/error/result/early_returns.md:7
msgid ""
"That is, we can simply stop executing the function and return the error if "
-"one occurs. For some, this form of code can be easier to both read and write. "
-"Consider this version of the previous example, rewritten using early returns:"
+"one occurs. For some, this form of code can be easier to both read and "
+"write. Consider this version of the previous example, rewritten using early "
+"returns:"
msgstr ""
"也就是说,如果发生错误,我们可以简单地停止执行函数并返回错误。对某些人来说,"
-"这种形式的代码可能更容易阅读和编写。考虑使用提前返回重写的前面示例的这个版本:"
+"这种形式的代码可能更容易阅读和编写。考虑使用提前返回重写的前面示例的这个版"
+"本:"
#: src/error/result/early_returns.md:41
msgid ""
@@ -12107,7 +12556,8 @@
"In the next section, we'll introduce `?` for the cases where we simply need "
"to `unwrap` without possibly inducing `panic`."
msgstr ""
-"在下一节中,我们将介绍 `?` 运算符,用于我们只需要 `unwrap` 而不可能引发 `panic` 的情况。"
+"在下一节中,我们将介绍 `?` 运算符,用于我们只需要 `unwrap` 而不可能引发 "
+"`panic` 的情况。"
#: src/error/result/enter_question_mark.md:3
msgid ""
@@ -12116,8 +12566,9 @@
"what we really wanted was to get the variable _out_. This is exactly the "
"purpose of `?`."
msgstr ""
-"有时我们只想要 `unwrap` 的简单性,而不希望有 `panic` 的可能。到目前为止,当我们"
-"真正想要的是获取变量**值**时,`unwrap` 迫使我们不断地增加嵌套。这正是 `?` 运算符的目的。"
+"有时我们只想要 `unwrap` 的简单性,而不希望有 `panic` 的可能。到目前为止,当我"
+"们真正想要的是获取变量**值**时,`unwrap` 迫使我们不断地增加嵌套。这正是 `?` "
+"运算符的目的。"
#: src/error/result/enter_question_mark.md:7
msgid "Upon finding an `Err`, there are two valid actions to take:"
@@ -12133,12 +12584,12 @@
#: src/error/result/enter_question_mark.md:12
msgid ""
-"`?` is _almost_[^†] exactly equivalent to an `unwrap` which `return`s instead "
-"of `panic`king on `Err`s. Let's see how we can simplify the earlier example "
-"that used combinators:"
+"`?` is _almost_[^†] exactly equivalent to an `unwrap` which `return`s "
+"instead of `panic`king on `Err`s. Let's see how we can simplify the earlier "
+"example that used combinators:"
msgstr ""
-"`?` 运算符**几乎**[^†]等同于在遇到 `Err` 时执行 `return` 而非 `panic` 的 `unwrap`。"
-"让我们看看如何简化之前使用组合器的例子:"
+"`?` 运算符**几乎**[^†]等同于在遇到 `Err` 时执行 `return` 而非 `panic` 的 "
+"`unwrap`。让我们看看如何简化之前使用组合器的例子:"
#: src/error/result/enter_question_mark.md:39
msgid "The `try!` macro"
@@ -12151,9 +12602,9 @@
"when looking at older code. The same `multiply` function from the previous "
"example would look like this using `try!`:"
msgstr ""
-"在 `?` 运算符出现之前,相同的功能是通过 `try!` 宏实现的。现在推荐使用 `?` 运算符,"
-"但在查看旧代码时,你可能仍会遇到 `try!`。使用 `try!` 宏,前面例子中的 `multiply` 函数"
-"会是这样的:"
+"在 `?` 运算符出现之前,相同的功能是通过 `try!` 宏实现的。现在推荐使用 `?` 运"
+"算符,但在查看旧代码时,你可能仍会遇到 `try!`。使用 `try!` 宏,前面例子中的 "
+"`multiply` 函数会是这样的:"
#: src/error/result/enter_question_mark.md:47
msgid ""
@@ -12165,19 +12616,21 @@
"// 要使用 Cargo 编译并运行此示例而不出错,请将 `Cargo.toml` 文件中\n"
"// `[package]` 部分的 `edition` 字段值更改为 \"2015\"。\n"
-#: src/error/result/enter_question_mark.md:73
+#: src/error/result/enter_question_mark.md:72
msgid ""
"See [re-enter ?](../multiple_error_types/reenter_question_mark.md) for more "
"details."
msgstr ""
-"更多详情请参阅[重新认识 ?](../multiple_error_types/reenter_question_mark.md)。"
+"更多详情请参阅[重新认识 ?](../multiple_error_types/"
+"reenter_question_mark.md)。"
#: src/error/multiple_error_types.md:3
msgid ""
"The previous examples have always been very convenient; `Result`s interact "
"with other `Result`s and `Option`s interact with other `Option`s."
msgstr ""
-"前面的例子一直都很方便:`Result` 与 `Result` 交互,`Option` 与 `Option` 交互。"
+"前面的例子一直都很方便:`Result` 与 `Result` 交互,`Option` 与 `Option` 交"
+"互。"
#: src/error/multiple_error_types.md:6
msgid ""
@@ -12186,8 +12639,9 @@
"want to manage our different error types in a way that makes them composable "
"and easy to interact with."
msgstr ""
-"有时,`Option` 需要与 `Result` 交互,或者 `Result<T, Error1>` 需要与 `Result<T, Error2>` 交互。"
-"在这些情况下,我们希望以一种使不同错误类型可组合且易于交互的方式来管理它们。"
+"有时,`Option` 需要与 `Result` 交互,或者 `Result<T, Error1>` 需要与 "
+"`Result<T, Error2>` 交互。在这些情况下,我们希望以一种使不同错误类型可组合且"
+"易于交互的方式来管理它们。"
#: src/error/multiple_error_types.md:11
msgid ""
@@ -12195,8 +12649,8 @@
"types. `Vec::first` returns an `Option`, while `parse::<i32>` returns a "
"`Result<i32, ParseIntError>`:"
msgstr ""
-"在下面的代码中,两个 `unwrap` 实例生成了不同的错误类型。`Vec::first` 返回一个 `Option`,"
-"而 `parse::<i32>` 返回一个 `Result<i32, ParseIntError>`:"
+"在下面的代码中,两个 `unwrap` 实例生成了不同的错误类型。`Vec::first` 返回一"
+"个 `Option`,而 `parse::<i32>` 返回一个 `Result<i32, ParseIntError>`:"
#: src/error/multiple_error_types.md:17
msgid "// Generate error 1\n"
@@ -12314,20 +12768,23 @@
"`None`. The `transpose` function comes in handy to swap the `Result` and "
"`Option`."
msgstr ""
-"有时我们希望在遇到错误时停止处理(例如使用 [`?`](../result/enter_question_mark.md)),但在 `Option` 为 `None` 时继续执行。"
-"这时 `transpose` 函数就派上用场了,它可以方便地交换 `Result` 和 `Option`。"
+"有时我们希望在遇到错误时停止处理(例如使用 [`?`](../result/"
+"enter_question_mark.md)),但在 `Option` 为 `None` 时继续执行。这时 "
+"`transpose` 函数就派上用场了,它可以方便地交换 `Result` 和 `Option`。"
#: src/error/multiple_error_types/define_error_type.md:3
msgid ""
"Sometimes it simplifies the code to mask all of the different errors with a "
"single type of error. We'll show this with a custom error."
-msgstr "有时,用单一类型的错误来掩盖所有不同的错误可以简化代码。我们将通过自定义错误来演示这一点。"
+msgstr ""
+"有时,用单一类型的错误来掩盖所有不同的错误可以简化代码。我们将通过自定义错误"
+"来演示这一点。"
#: src/error/multiple_error_types/define_error_type.md:6
msgid ""
"Rust allows us to define our own error types. In general, a \"good\" error "
"type:"
-msgstr "Rust 允许我们定义自己的错误类型。通常,一个"好的"错误类型应该:"
+msgstr "Rust 允许我们定义自己的错误类型。通常,一个\"好的\"错误类型应该:"
#: src/error/multiple_error_types/define_error_type.md:8
msgid "Represents different errors with the same type"
@@ -12346,7 +12803,8 @@
msgstr "好的示例:`Err(EmptyVec)`"
#: src/error/multiple_error_types/define_error_type.md:12
-msgid "Bad: `Err(\"Please use a vector with at least one element\".to_owned())`"
+msgid ""
+"Bad: `Err(\"Please use a vector with at least one element\".to_owned())`"
msgstr "不好的示例:`Err(\"请使用至少包含一个元素的向量\".to_owned())`"
#: src/error/multiple_error_types/define_error_type.md:13
@@ -12369,7 +12827,8 @@
msgid ""
"// Define our error types. These may be customized for our error handling "
"cases.\n"
-"// Now we will be able to write our own errors, defer to an underlying error\n"
+"// Now we will be able to write our own errors, defer to an underlying "
+"error\n"
"// implementation, or do something in between.\n"
msgstr ""
"// 定义我们的错误类型。这些可以根据我们的错误处理情况进行自定义。\n"
@@ -12415,18 +12874,21 @@
"determined](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#trait-"
"objects-perform-dynamic-dispatch)."
msgstr ""
-"一种既能编写简洁代码又能保留原始错误信息的方法是使用 [`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) 将它们装箱。"
-"这种方法的缺点是底层错误类型只能在运行时确定,而不是[静态确定](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#trait-objects-perform-dynamic-dispatch)的。"
+"一种既能编写简洁代码又能保留原始错误信息的方法是使用 [`Box`](https://"
+"doc.rust-lang.org/std/boxed/struct.Box.html) 将它们装箱。这种方法的缺点是底层"
+"错误类型只能在运行时确定,而不是[静态确定](https://doc.rust-lang.org/book/"
+"ch17-02-trait-objects.html#trait-objects-perform-dynamic-dispatch)的。"
#: src/error/multiple_error_types/boxing_errors.md:7
msgid ""
"The stdlib helps in boxing our errors by having `Box` implement conversion "
"from any type that implements the `Error` trait into the trait object "
-"`Box<Error>`, via [`From`](https://doc.rust-lang.org/std/convert/trait.From."
-"html)."
+"`Box<Error>`, via [`From`](https://doc.rust-lang.org/std/convert/"
+"trait.From.html)."
msgstr ""
-"标准库通过让 `Box` 实现从任何实现了 `Error` trait 的类型到 trait 对象 `Box<Error>` 的转换来帮助我们装箱错误,"
-"这是通过 [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) 实现的。"
+"标准库通过让 `Box` 实现从任何实现了 `Error` trait 的类型到 trait 对象 "
+"`Box<Error>` 的转换来帮助我们装箱错误,这是通过 [`From`](https://doc.rust-"
+"lang.org/std/convert/trait.From.html) 实现的。"
#: src/error/multiple_error_types/boxing_errors.md:14
#: src/error/multiple_error_types/reenter_question_mark.md:28
@@ -12440,20 +12902,21 @@
#: src/error/multiple_error_types/boxing_errors.md:59
msgid ""
-"[Dynamic dispatch](https://doc.rust-lang.org/book/ch17-02-trait-objects."
-"html#trait-objects-perform-dynamic-dispatch) and [`Error` trait](https://doc."
-"rust-lang.org/std/error/trait.Error.html)"
+"[Dynamic dispatch](https://doc.rust-lang.org/book/ch17-02-trait-"
+"objects.html#trait-objects-perform-dynamic-dispatch) and [`Error` trait]"
+"(https://doc.rust-lang.org/std/error/trait.Error.html)"
msgstr ""
-"[动态分发](https://doc.rust-lang.org/book/ch17-02-trait-objects."
-"html#trait-objects-perform-dynamic-dispatch)和 [`Error` trait](https://doc."
-"rust-lang.org/std/error/trait.Error.html)"
+"[动态分发](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#trait-"
+"objects-perform-dynamic-dispatch)和 [`Error` trait](https://doc.rust-"
+"lang.org/std/error/trait.Error.html)"
#: src/error/multiple_error_types/reenter_question_mark.md:3
msgid ""
-"Notice in the previous example that our immediate reaction to calling `parse` "
-"is to `map` the error from a library error into a boxed error:"
+"Notice in the previous example that our immediate reaction to calling "
+"`parse` is to `map` the error from a library error into a boxed error:"
msgstr ""
-"注意在前面的例子中,我们对调用 `parse` 的直接反应是将库错误通过 `map` 转换为一个装箱的错误:"
+"注意在前面的例子中,我们对调用 `parse` 的直接反应是将库错误通过 `map` 转换为"
+"一个装箱的错误:"
#: src/error/multiple_error_types/reenter_question_mark.md:12
msgid ""
@@ -12461,27 +12924,29 @@
"could be elided. Alas, because `and_then` is not sufficiently flexible, it "
"cannot. However, we can instead use `?`."
msgstr ""
-"由于这是一个简单且常见的操作,如果能够省略就会很方便。可惜的是,由于 `and_then` 不够灵活,"
-"所以无法实现这一点。不过,我们可以使用 `?` 来替代。"
+"由于这是一个简单且常见的操作,如果能够省略就会很方便。可惜的是,由于 "
+"`and_then` 不够灵活,所以无法实现这一点。不过,我们可以使用 `?` 来替代。"
#: src/error/multiple_error_types/reenter_question_mark.md:16
msgid ""
-"`?` was previously explained as either `unwrap` or `return Err(err)`. This is "
-"only mostly true. It actually means `unwrap` or `return Err(From::"
-"from(err))`. Since `From::from` is a conversion utility between different "
-"types, this means that if you `?` where the error is convertible to the "
-"return type, it will convert automatically."
+"`?` was previously explained as either `unwrap` or `return Err(err)`. This "
+"is only mostly true. It actually means `unwrap` or `return "
+"Err(From::from(err))`. Since `From::from` is a conversion utility between "
+"different types, this means that if you `?` where the error is convertible "
+"to the return type, it will convert automatically."
msgstr ""
-"之前我们将 `?` 解释为 `unwrap` 或 `return Err(err)`。这只是大致正确。实际上,它的含义是 `unwrap` 或 "
-"`return Err(From::from(err))`。由于 `From::from` 是不同类型之间的转换工具,这意味着如果你在错误可转换为返回类型的地方使用 `?`,"
-"它将自动进行转换。"
+"之前我们将 `?` 解释为 `unwrap` 或 `return Err(err)`。这只是大致正确。实际上,"
+"它的含义是 `unwrap` 或 `return Err(From::from(err))`。由于 `From::from` 是不"
+"同类型之间的转换工具,这意味着如果你在错误可转换为返回类型的地方使用 `?`,它"
+"将自动进行转换。"
#: src/error/multiple_error_types/reenter_question_mark.md:22
msgid ""
"Here, we rewrite the previous example using `?`. As a result, the `map_err` "
"will go away when `From::from` is implemented for our error type:"
msgstr ""
-"在这里,我们使用 `?` 重写了前面的例子。当为我们的错误类型实现 `From::from` 后,`map_err` 就不再需要了:"
+"在这里,我们使用 `?` 重写了前面的例子。当为我们的错误类型实现 `From::from` "
+"后,`map_err` 就不再需要了:"
#: src/error/multiple_error_types/reenter_question_mark.md:42
msgid ""
@@ -12497,8 +12962,9 @@
"very similar to replacing the `unwrap` calls with `?` except that the return "
"types are `Result`. As a result, they must be destructured at the top level."
msgstr ""
-"现在代码变得相当简洁了。与原来使用 `panic` 的版本相比,这种方法非常类似于用 `?` 替换 `unwrap` 调用,"
-"只是返回类型变成了 `Result`。因此,需要在顶层对结果进行解构。"
+"现在代码变得相当简洁了。与原来使用 `panic` 的版本相比,这种方法非常类似于用 "
+"`?` 替换 `unwrap` 调用,只是返回类型变成了 `Result`。因此,需要在顶层对结果进"
+"行解构。"
#: src/error/multiple_error_types/reenter_question_mark.md:76
msgid ""
@@ -12506,8 +12972,8 @@
"`](https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-"
"question-mark-operator)"
msgstr ""
-"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html)和"
-"[`?`运算符](https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-"
+"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html)和[`?`运"
+"算符](https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-"
"question-mark-operator)"
#: src/error/multiple_error_types/wrap_error.md:3
@@ -12530,8 +12996,7 @@
msgid ""
"// The wrapped error contains additional information and is available\n"
" // via the source() method.\n"
-msgstr ""
-"// 包装的错误包含额外信息,可通过 source() 方法获取。\n"
+msgstr "// 包装的错误包含额外信息,可通过 source() 方法获取。\n"
#: src/error/multiple_error_types/wrap_error.md:29
msgid "\"the provided string could not be parsed as int\""
@@ -12560,7 +13025,8 @@
#: src/error/multiple_error_types/wrap_error.md:57
msgid ""
-"// Here we implicitly use the `ParseIntError` implementation of `From` (which\n"
+"// Here we implicitly use the `ParseIntError` implementation of `From` "
+"(which\n"
" // we defined above) in order to create a `DoubleError`.\n"
msgstr ""
"// 这里我们隐式使用了 `ParseIntError` 的 `From` 实现(我们在上面定义的)\n"
@@ -12576,22 +13042,21 @@
"in all applications. There are some libraries that can take care of the "
"boilerplate for you."
msgstr ""
-"这种方法增加了一些处理错误的样板代码,可能并非所有应用程序都需要。"
-"有一些库可以帮你处理这些样板代码。"
+"这种方法增加了一些处理错误的样板代码,可能并非所有应用程序都需要。有一些库可"
+"以帮你处理这些样板代码。"
#: src/error/multiple_error_types/wrap_error.md:93
msgid ""
"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html) and "
"[`Enums`](../../custom_types/enum.md)"
msgstr ""
-"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html) 和"
-"[`枚举`](../../custom_types/enum.md)"
+"[`From::from`](https://doc.rust-lang.org/std/convert/trait.From.html) 和[`枚"
+"举`](../../custom_types/enum.md)"
-#: src/error/multiple_error_types/wrap_error.md:96
+#: src/error/multiple_error_types/wrap_error.md:95
msgid ""
"[`Crates for handling errors`](https://crates.io/keywords/error-handling)"
-msgstr ""
-"[处理错误的 crate](https://crates.io/keywords/error-handling)"
+msgstr "[处理错误的 crate](https://crates.io/keywords/error-handling)"
#: src/error/iter_result.md:3
msgid "An `Iter::map` operation might fail, for example:"
@@ -12624,8 +13089,8 @@
"`map_err` calls a function with the error, so by adding that to the previous "
"`filter_map` solution we can save them off to the side while iterating."
msgstr ""
-"`map_err` 会对错误调用一个函数,因此将其添加到之前的 `filter_map` 解决方案中,"
-"我们可以在迭代时将错误项保存到一旁。"
+"`map_err` 会对错误调用一个函数,因此将其添加到之前的 `filter_map` 解决方案"
+"中,我们可以在迭代时将错误项保存到一旁。"
#: src/error/iter_result.md:40
msgid "\"999\""
@@ -12652,9 +13117,9 @@
"(`Result<Vec<T>, E>`). Once an `Result::Err` is found, the iteration will "
"terminate."
msgstr ""
-"`Result` 实现了 `FromIterator` trait,因此结果的向量(`Vec<Result<T, E>>`)"
-"可以转换为包含向量的结果(`Result<Vec<T>, E>`)。一旦遇到 `Result::Err`,"
-"迭代就会终止。"
+"`Result` 实现了 `FromIterator` trait,因此结果的向量(`Vec<Result<T, E>>`)可"
+"以转换为包含向量的结果(`Result<Vec<T>, E>`)。一旦遇到 `Result::Err`,迭代就"
+"会终止。"
#: src/error/iter_result.md:69
msgid "This same technique can be used with `Option`."
@@ -12666,17 +13131,17 @@
#: src/error/iter_result.md:85
msgid ""
-"When you look at the results, you'll note that everything is still wrapped in "
-"`Result`. A little more boilerplate is needed for this."
+"When you look at the results, you'll note that everything is still wrapped "
+"in `Result`. A little more boilerplate is needed for this."
msgstr ""
-"当你查看结果时,你会注意到所有内容仍然被包装在 `Result` 中。这需要一些额外的样板代码。"
+"当你查看结果时,你会注意到所有内容仍然被包装在 `Result` 中。这需要一些额外的"
+"样板代码。"
#: src/std.md:3
msgid ""
-"The `std` library provides many custom types which expands drastically on the "
-"`primitives`. Some of these include:"
-msgstr ""
-"`std` 库提供了许多自定义类型,大大扩展了"原生类型"的功能。其中包括:"
+"The `std` library provides many custom types which expands drastically on "
+"the `primitives`. Some of these include:"
+msgstr "`std` 库提供了许多自定义类型,大大扩展了\"原生类型\"的功能。其中包括:"
#: src/std.md:6
msgid "growable `String`s like: `\"hello world\"`"
@@ -12702,34 +13167,31 @@
msgid ""
"[primitives](primitives.md) and [the std library](https://doc.rust-lang.org/"
"std/)"
-msgstr ""
-"[原生类型](primitives.md)和[标准库](https://doc.rust-lang.org/std/)"
+msgstr "[原生类型](primitives.md)和[标准库](https://doc.rust-lang.org/std/)"
#: src/std/box.md:3
msgid ""
"All values in Rust are stack allocated by default. Values can be _boxed_ "
-"(allocated on the heap) by creating a `Box<T>`. A box is a smart pointer to a "
-"heap allocated value of type `T`. When a box goes out of scope, its "
+"(allocated on the heap) by creating a `Box<T>`. A box is a smart pointer to "
+"a heap allocated value of type `T`. When a box goes out of scope, its "
"destructor is called, the inner object is destroyed, and the memory on the "
"heap is freed."
msgstr ""
-"在 Rust 中,所有值默认都是栈分配的。通过创建 `Box<T>`,可以将值**装箱**(在堆上分配)。"
-"Box 是指向堆分配的 `T` 类型值的智能指针。当 Box 离开作用域时,会调用其析构函数,"
-"内部对象被销毁,堆上的内存被释放。"
+"在 Rust 中,所有值默认都是栈分配的。通过创建 `Box<T>`,可以将值**装箱**(在堆"
+"上分配)。Box 是指向堆分配的 `T` 类型值的智能指针。当 Box 离开作用域时,会调"
+"用其析构函数,内部对象被销毁,堆上的内存被释放。"
#: src/std/box.md:8
msgid ""
"Boxed values can be dereferenced using the `*` operator; this removes one "
"layer of indirection."
-msgstr ""
-"可以使用 `*` 运算符解引用装箱的值,这会移除一层间接引用。"
+msgstr "可以使用 `*` 运算符解引用装箱的值,这会移除一层间接引用。"
#: src/std/box.md:20
msgid ""
"// A Rectangle can be specified by where its top left and bottom right \n"
"// corners are in space\n"
-msgstr ""
-"// 可以通过指定左上角和右下角在空间中的位置来定义矩形\n"
+msgstr "// 可以通过指定左上角和右下角在空间中的位置来定义矩形\n"
#: src/std/box.md:34
msgid "// Allocate this point on the heap, and return a pointer to it\n"
@@ -12793,106 +13255,106 @@
"compile time, but they can grow or shrink at any time. A vector is "
"represented using 3 parameters:"
msgstr ""
-"向量(Vector)是可调整大小的数组。与切片(Slice)类似,它们的大小在编译时是未知的,但可以随时增长或缩小。"
-"向量由 3 个参数表示:"
+"向量(Vector)是可调整大小的数组。与切片(Slice)类似,它们的大小在编译时是未"
+"知的,但可以随时增长或缩小。向量由 3 个参数表示:"
-#: src/std/vec.md:6
+#: src/std/vec.md:7
msgid "pointer to the data"
msgstr "指向数据的指针"
-#: src/std/vec.md:7
+#: src/std/vec.md:8
msgid "length"
msgstr "长度"
-#: src/std/vec.md:8
+#: src/std/vec.md:9
msgid "capacity"
msgstr "容量"
-#: src/std/vec.md:10
+#: src/std/vec.md:11
msgid ""
-"The capacity indicates how much memory is reserved for the vector. The vector "
-"can grow as long as the length is smaller than the capacity. When this "
-"threshold needs to be surpassed, the vector is reallocated with a larger "
-"capacity."
+"The capacity indicates how much memory is reserved for the vector. The "
+"vector can grow as long as the length is smaller than the capacity. When "
+"this threshold needs to be surpassed, the vector is reallocated with a "
+"larger capacity."
msgstr ""
-"容量表示为向量预留的内存量。只要长度小于容量,向量就可以增长。当需要超过这个阈值时,"
-"向量会被重新分配更大的容量。"
+"容量表示为向量预留的内存量。只要长度小于容量,向量就可以增长。当需要超过这个"
+"阈值时,向量会被重新分配更大的容量。"
-#: src/std/vec.md:16
+#: src/std/vec.md:17
msgid "// Iterators can be collected into vectors\n"
msgstr "// 迭代器可以被收集到向量中\n"
-#: src/std/vec.md:18
+#: src/std/vec.md:19
msgid "\"Collected (0..10) into: {:?}\""
msgstr "\"将 (0..10) 收集到:{:?}\""
-#: src/std/vec.md:20
+#: src/std/vec.md:21
msgid "// The `vec!` macro can be used to initialize a vector\n"
msgstr "// 可以使用 `vec!` 宏初始化向量\n"
-#: src/std/vec.md:22
+#: src/std/vec.md:23
msgid "\"Initial vector: {:?}\""
msgstr "\"初始向量:{:?}\""
-#: src/std/vec.md:24
+#: src/std/vec.md:25
msgid "// Insert new element at the end of the vector\n"
msgstr "// 在向量末尾插入新元素\n"
-#: src/std/vec.md:25
+#: src/std/vec.md:26
msgid "\"Push 4 into the vector\""
msgstr "\"将 4 推入向量\""
-#: src/std/vec.md:27
+#: src/std/vec.md:28
msgid "\"Vector: {:?}\""
msgstr "\"向量:{:?}\""
-#: src/std/vec.md:29
+#: src/std/vec.md:30
msgid "// Error! Immutable vectors can't grow\n"
msgstr "// 错误!不可变向量无法增长\n"
-#: src/std/vec.md:33
+#: src/std/vec.md:34
msgid ""
"// The `len` method yields the number of elements currently stored in a "
"vector\n"
msgstr "// `len` 方法返回当前存储在向量中的元素数量\n"
-#: src/std/vec.md:34
+#: src/std/vec.md:35
msgid "\"Vector length: {}\""
msgstr "\"向量长度:{}\""
-#: src/std/vec.md:36
+#: src/std/vec.md:37
msgid "// Indexing is done using the square brackets (indexing starts at 0)\n"
msgstr "// 使用方括号进行索引(索引从 0 开始)\n"
-#: src/std/vec.md:37
+#: src/std/vec.md:38
msgid "\"Second element: {}\""
msgstr "\"第二个元素:{}\""
-#: src/std/vec.md:39
+#: src/std/vec.md:40
msgid "// `pop` removes the last element from the vector and returns it\n"
msgstr "// `pop` 移除并返回向量的最后一个元素\n"
-#: src/std/vec.md:40
+#: src/std/vec.md:41
msgid "\"Pop last element: {:?}\""
msgstr "\"弹出最后一个元素:{:?}\""
-#: src/std/vec.md:42
+#: src/std/vec.md:43
msgid "// Out of bounds indexing yields a panic\n"
msgstr "// 越界索引会导致 panic\n"
-#: src/std/vec.md:43
+#: src/std/vec.md:44
msgid "\"Fourth element: {}\""
msgstr "\"第四个元素:{}\""
-#: src/std/vec.md:46
+#: src/std/vec.md:47
msgid "// `Vector`s can be easily iterated over\n"
msgstr "// 可以轻松地遍历 `Vector`\n"
-#: src/std/vec.md:47
+#: src/std/vec.md:48
msgid "\"Contents of xs:\""
msgstr "\"xs 的内容:\""
-#: src/std/vec.md:52
+#: src/std/vec.md:53
msgid ""
"// A `Vector` can also be iterated over while the iteration\n"
" // count is enumerated in a separate variable (`i`)\n"
@@ -12900,11 +13362,11 @@
"// 遍历 `Vector` 时,可以同时用一个单独的变量(`i`)\n"
" // 来枚举迭代计数\n"
-#: src/std/vec.md:55
+#: src/std/vec.md:56
msgid "\"In position {} we have value {}\""
msgstr "\"在位置 {} 的值是 {}\""
-#: src/std/vec.md:58
+#: src/std/vec.md:59
msgid ""
"// Thanks to `iter_mut`, mutable `Vector`s can also be iterated\n"
" // over in a way that allows modifying each value\n"
@@ -12912,16 +13374,17 @@
"// 借助 `iter_mut`,可变的 `Vector` 也可以被遍历,\n"
" // 并且允许修改每个值\n"
-#: src/std/vec.md:63
+#: src/std/vec.md:64
msgid "\"Updated vector: {:?}\""
msgstr "\"更新后的向量:{:?}\""
-#: src/std/vec.md:67
+#: src/std/vec.md:68
msgid ""
-"More `Vec` methods can be found under the [std::vec](https://doc.rust-lang."
-"org/std/vec/) module"
+"More `Vec` methods can be found under the [std::vec](https://doc.rust-"
+"lang.org/std/vec/) module"
msgstr ""
-"更多 `Vec` 方法可以在 [std::vec](https://doc.rust-lang.org/std/vec/) 模块中找到"
+"更多 `Vec` 方法可以在 [std::vec](https://doc.rust-lang.org/std/vec/) 模块中找"
+"到"
#: src/std/str.md:3
msgid "The two most used string types in Rust are `String` and `&str`."
@@ -12933,14 +13396,17 @@
"always be a valid UTF-8 sequence. `String` is heap allocated, growable and "
"not null terminated."
msgstr ""
-"`String` 存储为字节向量(`Vec<u8>`),但保证始终是有效的 UTF-8 序列。`String` 在堆上分配,可增长,且不以 null 结尾。"
+"`String` 存储为字节向量(`Vec<u8>`),但保证始终是有效的 UTF-8 序列。"
+"`String` 在堆上分配,可增长,且不以 null 结尾。"
#: src/std/str.md:9
msgid ""
-"`&str` is a slice (`&[u8]`) that always points to a valid UTF-8 sequence, and "
-"can be used to view into a `String`, just like `&[T]` is a view into `Vec<T>`."
+"`&str` is a slice (`&[u8]`) that always points to a valid UTF-8 sequence, "
+"and can be used to view into a `String`, just like `&[T]` is a view into "
+"`Vec<T>`."
msgstr ""
-"`&str` 是一个切片(`&[u8]`),它始终指向一个有效的 UTF-8 序列,可以用来查看 `String`,就像 `&[T]` 是 `Vec<T>` 的一个视图一样。"
+"`&str` 是一个切片(`&[u8]`),它始终指向一个有效的 UTF-8 序列,可以用来查看 "
+"`String`,就像 `&[T]` 是 `Vec<T>` 的一个视图一样。"
#: src/std/str.md:14
msgid ""
@@ -12986,8 +13452,7 @@
msgid ""
"// The trimmed string is a slice to the original string, hence no new\n"
" // allocation is performed\n"
-msgstr ""
-"// 修剪后的字符串是原始字符串的一个切片,因此不会进行新的内存分配\n"
+msgstr "// 修剪后的字符串是原始字符串的一个切片,因此不会进行新的内存分配\n"
#: src/std/str.md:43
msgid "\"Used characters: {}\""
@@ -13023,12 +13488,12 @@
#: src/std/str.md:55
msgid ""
-"More `str`/`String` methods can be found under the [std::str](https://doc."
-"rust-lang.org/std/str/) and [std::string](https://doc.rust-lang.org/std/"
+"More `str`/`String` methods can be found under the [std::str](https://"
+"doc.rust-lang.org/std/str/) and [std::string](https://doc.rust-lang.org/std/"
"string/) modules"
msgstr ""
-"更多 `str` 和 `String` 的方法可以在 [std::str](https://doc.rust-lang.org/std/str/) "
-"和 [std::string](https://doc.rust-lang.org/std/string/) 模块中找到"
+"更多 `str` 和 `String` 的方法可以在 [std::str](https://doc.rust-lang.org/std/"
+"str/) 和 [std::string](https://doc.rust-lang.org/std/string/) 模块中找到"
#: src/std/str.md:60
msgid "Literals and escapes"
@@ -13037,24 +13502,24 @@
#: src/std/str.md:62
msgid ""
"There are multiple ways to write string literals with special characters in "
-"them. All result in a similar `&str` so it's best to use the form that is the "
-"most convenient to write. Similarly there are multiple ways to write byte "
-"string literals, which all result in `&[u8; N]`."
+"them. All result in a similar `&str` so it's best to use the form that is "
+"the most convenient to write. Similarly there are multiple ways to write "
+"byte string literals, which all result in `&[u8; N]`."
msgstr ""
"有多种方式可以编写包含特殊字符的字符串字面值。所有方式都会产生类似的 `&str`,"
-"因此最好使用最方便编写的形式。同样,也有多种方式可以编写字节字符串字面值,"
-"它们都会产生 `&[u8; N]` 类型。"
+"因此最好使用最方便编写的形式。同样,也有多种方式可以编写字节字符串字面值,它"
+"们都会产生 `&[u8; N]` 类型。"
#: src/std/str.md:67
msgid ""
"Generally special characters are escaped with a backslash character: `\\`. "
"This way you can add any character to your string, even unprintable ones and "
-"ones that you don't know how to type. If you want a literal backslash, escape "
-"it with another one: `\\\\`"
+"ones that you don't know how to type. If you want a literal backslash, "
+"escape it with another one: `\\\\`"
msgstr ""
-"通常,特殊字符用反斜杠(`\\`)进行转义。这样你可以在字符串中添加任何字符,"
-"包括不可打印的字符和你不知道如何输入的字符。如果你想要一个字面的反斜杠,"
-"用另一个反斜杠转义它:`\\\\`"
+"通常,特殊字符用反斜杠(`\\`)进行转义。这样你可以在字符串中添加任何字符,包"
+"括不可打印的字符和你不知道如何输入的字符。如果你想要一个字面的反斜杠,用另一"
+"个反斜杠转义它:`\\\\`"
#: src/std/str.md:72
msgid ""
@@ -13109,7 +13574,8 @@
"just much more convenient to write a string out as-is. This is where raw "
"string literals come into play."
msgstr ""
-"有时需要转义的字符太多,或者直接按原样写出字符串会更方便。这时就可以使用原始字符串字面值。"
+"有时需要转义的字符太多,或者直接按原样写出字符串会更方便。这时就可以使用原始"
+"字符串字面值。"
#: src/std/str.md:101
msgid "r\"Escapes don't work here: \\x3F \\u{211D}\""
@@ -13141,7 +13607,8 @@
"UTF-8). Or maybe you want an array of bytes that's mostly text? Byte strings "
"to the rescue!"
msgstr ""
-"想要一个非 UTF-8 的字符串吗?(请记住,`str` 和 `String` 必须是有效的 UTF-8)。或者你想要一个主要是文本的字节数组?字节字符串来帮忙!"
+"想要一个非 UTF-8 的字符串吗?(请记住,`str` 和 `String` 必须是有效的 "
+"UTF-8)。或者你想要一个主要是文本的字节数组?字节字符串来帮忙!"
#: src/std/str.md:122
msgid "// Note that this is not actually a `&str`\n"
@@ -13155,8 +13622,7 @@
msgid ""
"// Byte arrays don't have the `Display` trait, so printing them is a bit "
"limited\n"
-msgstr ""
-"// 字节数组没有 `Display` trait,所以打印它们有一些限制\n"
+msgstr "// 字节数组没有 `Display` trait,所以打印它们有一些限制\n"
#: src/std/str.md:126
msgid "\"A byte string: {:?}\""
@@ -13203,7 +13669,7 @@
"br#\"You can also use \"fancier\" formatting, \\\n"
" like with normal raw strings\"#"
msgstr ""
-"br#\"你也可以使用"更花哨的"格式,\\\n"
+"br#\"你也可以使用\"更花哨的\"格式,\\\n"
" 就像普通的原始字符串一样\"#"
#: src/std/str.md:147
@@ -13235,7 +13701,8 @@
"For conversions between character encodings check out the [encoding](https://"
"crates.io/crates/encoding) crate."
msgstr ""
-"对于字符编码之间的转换,请查看 [encoding](https://crates.io/crates/encoding) crate。"
+"对于字符编码之间的转换,请查看 [encoding](https://crates.io/crates/encoding) "
+"crate。"
#: src/std/str.md:160
msgid ""
@@ -13243,15 +13710,17 @@
"characters is given in the ['Tokens' chapter](https://doc.rust-lang.org/"
"reference/tokens.html) of the Rust Reference."
msgstr ""
-"关于编写字符串字面值和转义字符的更详细说明,请参阅 Rust 参考手册的[「标记」章节](https://doc.rust-lang.org/"
-"reference/tokens.html)。"
+"关于编写字符串字面值和转义字符的更详细说明,请参阅 Rust 参考手册的[「标记」章"
+"节](https://doc.rust-lang.org/reference/tokens.html)。"
#: src/std/option.md:3
msgid ""
"Sometimes it's desirable to catch the failure of some parts of a program "
-"instead of calling `panic!`; this can be accomplished using the `Option` enum."
+"instead of calling `panic!`; this can be accomplished using the `Option` "
+"enum."
msgstr ""
-"有时我们希望捕获程序某些部分的失败,而不是调用 `panic!`。这可以通过使用 `Option` 枚举来实现。"
+"有时我们希望捕获程序某些部分的失败,而不是调用 `panic!`。这可以通过使用 "
+"`Option` 枚举来实现。"
#: src/std/option.md:6
msgid "The `Option<T>` enum has two variants:"
@@ -13316,7 +13785,8 @@
"However, sometimes it is important to express _why_ an operation failed. To "
"do this we have the `Result` enum."
msgstr ""
-"我们已经看到 `Option` 枚举可以用作可能失败的函数的返回值,其中 `None` 用于表示失败。\n"
+"我们已经看到 `Option` 枚举可以用作可能失败的函数的返回值,其中 `None` 用于表"
+"示失败。\n"
"然而,有时表达操作失败的**原因**很重要。为此,我们有 `Result` 枚举。"
#: src/std/result.md:8
@@ -13328,25 +13798,26 @@
"`Ok(value)` which indicates that the operation succeeded, and wraps the "
"`value` returned by the operation. (`value` has type `T`)"
msgstr ""
-"`Ok(value)`:表示操作成功,并包装了操作返回的 `value`。(`value` 的类型为 `T`)"
+"`Ok(value)`:表示操作成功,并包装了操作返回的 `value`。(`value` 的类型为 "
+"`T`)"
#: src/std/result.md:12
msgid ""
-"`Err(why)`, which indicates that the operation failed, and wraps `why`, which "
-"(hopefully) explains the cause of the failure. (`why` has type `E`)"
+"`Err(why)`, which indicates that the operation failed, and wraps `why`, "
+"which (hopefully) explains the cause of the failure. (`why` has type `E`)"
msgstr ""
-"`Err(why)`:表示操作失败,并包装了 `why`,它(希望)解释了失败的原因。(`why` 的类型为 `E`)"
+"`Err(why)`:表示操作失败,并包装了 `why`,它(希望)解释了失败的原因。"
+"(`why` 的类型为 `E`)"
#: src/std/result.md:17
msgid "// Mathematical \"errors\" we want to catch\n"
-msgstr "// 我们想要捕获的数学"错误"\n"
+msgstr "// 我们想要捕获的数学\"错误\"\n"
#: src/std/result.md:29
msgid ""
"// This operation would `fail`, instead let's return the reason of\n"
" // the failure wrapped in `Err`\n"
-msgstr ""
-"// 这个操作会"失败",所以我们返回包装在 `Err` 中的失败原因\n"
+msgstr "// 这个操作会\"失败\",所以我们返回包装在 `Err` 中的失败原因\n"
#: src/std/result.md:33
msgid "// This operation is valid, return the result wrapped in `Ok`\n"
@@ -13366,15 +13837,16 @@
#: src/std/result/question_mark.md:3
msgid ""
-"Chaining results using match can get pretty untidy; luckily, the `?` operator "
-"can be used to make things pretty again. `?` is used at the end of an "
-"expression returning a `Result`, and is equivalent to a match expression, "
-"where the `Err(err)` branch expands to an early `return Err(From::"
-"from(err))`, and the `Ok(ok)` branch expands to an `ok` expression."
+"Chaining results using match can get pretty untidy; luckily, the `?` "
+"operator can be used to make things pretty again. `?` is used at the end of "
+"an expression returning a `Result`, and is equivalent to a match expression, "
+"where the `Err(err)` branch expands to an early `return "
+"Err(From::from(err))`, and the `Ok(ok)` branch expands to an `ok` expression."
msgstr ""
-"使用 match 链式处理结果可能会变得相当混乱;幸运的是,我们可以使用 `?` 运算符来让代码变得整洁。"
-"`?` 运算符用在返回 `Result` 的表达式末尾,等效于一个 match 表达式。在这个表达式中,"
-"`Err(err)` 分支会展开为提前返回的 `return Err(From::from(err))`,而 `Ok(ok)` 分支则展开为 `ok` 表达式。"
+"使用 match 链式处理结果可能会变得相当混乱;幸运的是,我们可以使用 `?` 运算符"
+"来让代码变得整洁。`?` 运算符用在返回 `Result` 的表达式末尾,等效于一个 match "
+"表达式。在这个表达式中,`Err(err)` 分支会展开为提前返回的 `return "
+"Err(From::from(err))`,而 `Ok(ok)` 分支则展开为 `ok` 表达式。"
#: src/std/result/question_mark.md:44
msgid "// Intermediate function\n"
@@ -13382,11 +13854,11 @@
#: src/std/result/question_mark.md:46
msgid "// if `div` \"fails\", then `DivisionByZero` will be `return`ed\n"
-msgstr "// 如果 `div` "失败",则会 `return` `DivisionByZero`\n"
+msgstr "// 如果 `div` \"失败\",则会 `return` `DivisionByZero`\n"
#: src/std/result/question_mark.md:49
msgid "// if `ln` \"fails\", then `NonPositiveLogarithm` will be `return`ed\n"
-msgstr "// 如果 `ln` "失败",则会 `return` `NonPositiveLogarithm`\n"
+msgstr "// 如果 `ln` \"失败\",则会 `return` `NonPositiveLogarithm`\n"
#: src/std/result/question_mark.md:59
msgid "\"logarithm of non-positive number\""
@@ -13405,8 +13877,8 @@
"Be sure to check the [documentation](https://doc.rust-lang.org/std/result/"
"index.html), as there are many methods to map/compose `Result`."
msgstr ""
-"请务必查阅 [文档](https://doc.rust-lang.org/std/result/index.html),"
-"其中包含了许多用于映射和组合 `Result` 的方法。"
+"请务必查阅 [文档](https://doc.rust-lang.org/std/result/index.html),其中包含"
+"了许多用于映射和组合 `Result` 的方法。"
#: src/std/panic.md:3
msgid ""
@@ -13414,15 +13886,16 @@
"stack. While unwinding, the runtime will take care of freeing all the "
"resources _owned_ by the thread by calling the destructor of all its objects."
msgstr ""
-"`panic!` 宏可用于生成一个 panic 并开始展开其栈。在展开过程中,"
-"运行时会通过调用该线程所有对象的析构函数来释放线程**拥有**的所有资源。"
+"`panic!` 宏可用于生成一个 panic 并开始展开其栈。在展开过程中,运行时会通过调"
+"用该线程所有对象的析构函数来释放线程**拥有**的所有资源。"
#: src/std/panic.md:7
msgid ""
"Since we are dealing with programs with only one thread, `panic!` will cause "
"the program to report the panic message and exit."
msgstr ""
-"由于我们处理的是只有一个线程的程序,`panic!` 会导致程序报告 panic 消息并退出。"
+"由于我们处理的是只有一个线程的程序,`panic!` 会导致程序报告 panic 消息并退"
+"出。"
#: src/std/panic.md:11
msgid "// Re-implementation of integer division (/)\n"
@@ -13462,8 +13935,9 @@
"key. `HashMap` keys can be booleans, integers, strings, or any other type "
"that implements the `Eq` and `Hash` traits. More on this in the next section."
msgstr ""
-"向量(Vector)通过整数索引存储值,而 `HashMap` 则通过键存储值。`HashMap` 的键可以是布尔值、"
-"整数、字符串,或任何其他实现了 `Eq` 和 `Hash` trait 的类型。下一节将详细介绍这一点。"
+"向量(Vector)通过整数索引存储值,而 `HashMap` 则通过键存储值。`HashMap` 的键"
+"可以是布尔值、整数、字符串,或任何其他实现了 `Eq` 和 `Hash` trait 的类型。下"
+"一节将详细介绍这一点。"
#: src/std/hash.md:8
msgid ""
@@ -13473,8 +13947,8 @@
"`HashMap::new()` to get a HashMap with a default initial capacity "
"(recommended)."
msgstr ""
-"与向量类似,`HashMap` 也可以增长,但当有多余空间时,HashMap 还能自动收缩。"
-"你可以使用 `HashMap::with_capacity(uint)` 创建一个具有指定初始容量的 HashMap,"
+"与向量类似,`HashMap` 也可以增长,但当有多余空间时,HashMap 还能自动收缩。你"
+"可以使用 `HashMap::with_capacity(uint)` 创建一个具有指定初始容量的 HashMap,"
"或使用 `HashMap::new()` 来获得一个具有默认初始容量的 HashMap(推荐)。"
#: src/std/hash.md:19 src/std/hash.md:30
@@ -13579,8 +14053,8 @@
"tables) work, have a look at [Hash Table Wikipedia](https://en.wikipedia.org/"
"wiki/Hash_table)"
msgstr ""
-"要了解更多关于哈希和哈希映射(有时称为哈希表)的工作原理,请参阅[哈希表的维基百科页面]"
-"(https://en.wikipedia.org/wiki/Hash_table)"
+"要了解更多关于哈希和哈希映射(有时称为哈希表)的工作原理,请参阅[哈希表的维基"
+"百科页面](https://en.wikipedia.org/wiki/Hash_table)"
#: src/std/hash/alt_key_types.md:3
msgid ""
@@ -13602,50 +14076,53 @@
"`String` and `&str` (protip: you can have a `HashMap` keyed by `String` and "
"call `.get()` with an `&str`)"
msgstr ""
-"`String` 和 `&str`(专业提示:你可以使用 `String` 作为 `HashMap` 的键,"
-"并用 `&str` 调用 `.get()` 方法)"
+"`String` 和 `&str`(专业提示:你可以使用 `String` 作为 `HashMap` 的键,并用 "
+"`&str` 调用 `.get()` 方法)"
#: src/std/hash/alt_key_types.md:11
msgid ""
-"Note that `f32` and `f64` do _not_ implement `Hash`, likely because [floating-"
-"point precision errors](https://en.wikipedia.org/wiki/"
+"Note that `f32` and `f64` do _not_ implement `Hash`, likely because "
+"[floating-point precision errors](https://en.wikipedia.org/wiki/"
"Floating_point#Accuracy_problems) would make using them as hashmap keys "
"horribly error-prone."
msgstr ""
-"注意,`f32` 和 `f64` **并未**实现 `Hash` trait,这很可能是因为[浮点数精度误差]"
-"(https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems)会导致将它们用作哈希映射的键时极易出错。"
+"注意,`f32` 和 `f64` **并未**实现 `Hash` trait,这很可能是因为[浮点数精度误"
+"差](https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems)会导致将它"
+"们用作哈希映射的键时极易出错。"
#: src/std/hash/alt_key_types.md:15
msgid ""
-"All collection classes implement `Eq` and `Hash` if their contained type also "
-"respectively implements `Eq` and `Hash`. For example, `Vec<T>` will implement "
-"`Hash` if `T` implements `Hash`."
+"All collection classes implement `Eq` and `Hash` if their contained type "
+"also respectively implements `Eq` and `Hash`. For example, `Vec<T>` will "
+"implement `Hash` if `T` implements `Hash`."
msgstr ""
-"如果集合类中包含的类型分别实现了 `Eq` 和 `Hash`,那么这些集合类也会实现 `Eq` 和 `Hash`。"
-"例如,如果 `T` 实现了 `Hash`,那么 `Vec<T>` 也会实现 `Hash`。"
+"如果集合类中包含的类型分别实现了 `Eq` 和 `Hash`,那么这些集合类也会实现 `Eq` "
+"和 `Hash`。例如,如果 `T` 实现了 `Hash`,那么 `Vec<T>` 也会实现 `Hash`。"
#: src/std/hash/alt_key_types.md:19
msgid ""
"You can easily implement `Eq` and `Hash` for a custom type with just one "
"line: `#[derive(PartialEq, Eq, Hash)]`"
msgstr ""
-"你可以通过一行代码轻松地为自定义类型实现 `Eq` 和 `Hash`:`#[derive(PartialEq, Eq, Hash)]`"
+"你可以通过一行代码轻松地为自定义类型实现 `Eq` 和 `Hash`:"
+"`#[derive(PartialEq, Eq, Hash)]`"
#: src/std/hash/alt_key_types.md:22
msgid ""
-"The compiler will do the rest. If you want more control over the details, you "
-"can implement `Eq` and/or `Hash` yourself. This guide will not cover the "
+"The compiler will do the rest. If you want more control over the details, "
+"you can implement `Eq` and/or `Hash` yourself. This guide will not cover the "
"specifics of implementing `Hash`."
msgstr ""
-"编译器会完成剩余的工作。如果你想对细节有更多控制,可以自己实现 `Eq` 和/或 `Hash`。"
-"本指南不会涉及实现 `Hash` 的具体细节。"
+"编译器会完成剩余的工作。如果你想对细节有更多控制,可以自己实现 `Eq` 和/或 "
+"`Hash`。本指南不会涉及实现 `Hash` 的具体细节。"
#: src/std/hash/alt_key_types.md:26
msgid ""
"To play around with using a `struct` in `HashMap`, let's try making a very "
"simple user logon system:"
msgstr ""
-"为了尝试在 `HashMap` 中使用 `struct`,让我们来创建一个非常简单的用户登录系统:"
+"为了尝试在 `HashMap` 中使用 `struct`,让我们来创建一个非常简单的用户登录系"
+"统:"
#: src/std/hash/alt_key_types.md:31
msgid "// Eq requires that you derive PartialEq on the type.\n"
@@ -13705,14 +14182,14 @@
"Consider a `HashSet` as a `HashMap` where we just care about the keys "
"( `HashSet<T>` is, in actuality, just a wrapper around `HashMap<T, ()>`)."
msgstr ""
-"可以将 `HashSet` 视为一个只关心键的 `HashMap`(实际上,`HashSet<T>` 只是 `HashMap<T, ()>` 的封装)。"
+"可以将 `HashSet` 视为一个只关心键的 `HashMap`(实际上,`HashSet<T>` 只是 "
+"`HashMap<T, ()>` 的封装)。"
#: src/std/hash/hashset.md:6
msgid ""
"\"What's the point of that?\" you ask. \"I could just store the keys in a "
"`Vec`.\""
-msgstr ""
-"你可能会问:"这有什么意义?我可以直接把键存储在 `Vec` 中啊。""
+msgstr "你可能会问:\"这有什么意义?我可以直接把键存储在 `Vec` 中啊。\""
#: src/std/hash/hashset.md:8
msgid ""
@@ -13721,21 +14198,23 @@
"just one implementation. (see also: [`BTreeSet`](https://doc.rust-lang.org/"
"std/collections/struct.BTreeSet.html))"
msgstr ""
-"`HashSet` 的独特之处在于它保证不会有重复元素。这是所有集合类型都应满足的约定。`HashSet` 只是其中一种实现。(另请参阅:[`BTreeSet`]"
-"(https://doc.rust-lang.org/std/collections/struct.BTreeSet.html))"
+"`HashSet` 的独特之处在于它保证不会有重复元素。这是所有集合类型都应满足的约"
+"定。`HashSet` 只是其中一种实现。(另请参阅:[`BTreeSet`](https://doc.rust-"
+"lang.org/std/collections/struct.BTreeSet.html))"
#: src/std/hash/hashset.md:13
msgid ""
-"If you insert a value that is already present in the `HashSet`, (i.e. the new "
-"value is equal to the existing and they both have the same hash), then the "
-"new value will replace the old."
+"If you insert a value that is already present in the `HashSet`, (i.e. the "
+"new value is equal to the existing and they both have the same hash), then "
+"the new value will replace the old."
msgstr ""
-"如果你插入一个已存在于 `HashSet` 中的值(即新值等于现有值,且它们的哈希值相同),那么新值将替换旧值。"
+"如果你插入一个已存在于 `HashSet` 中的值(即新值等于现有值,且它们的哈希值相"
+"同),那么新值将替换旧值。"
#: src/std/hash/hashset.md:17
msgid ""
-"This is great for when you never want more than one of something, or when you "
-"want to know if you've already got something."
+"This is great for when you never want more than one of something, or when "
+"you want to know if you've already got something."
msgstr ""
"当你不希望某个元素出现多次,或者想知道是否已经拥有某个元素时,这非常有用。"
@@ -13747,8 +14226,7 @@
msgid ""
"Sets have 4 primary operations (all of the following calls return an "
"iterator):"
-msgstr ""
-"集合有 4 种主要操作(以下所有调用都返回一个迭代器):"
+msgstr "集合有 4 种主要操作(以下所有调用都返回一个迭代器):"
#: src/std/hash/hashset.md:24
msgid "`union`: get all the unique elements in both sets."
@@ -13758,7 +14236,8 @@
msgid ""
"`difference`: get all the elements that are in the first set but not the "
"second."
-msgstr "差集(`difference`):获取存在于第一个集合但不在第二个集合中的所有元素。"
+msgstr ""
+"差集(`difference`):获取存在于第一个集合但不在第二个集合中的所有元素。"
#: src/std/hash/hashset.md:28
msgid "`intersection`: get all the elements that are only in _both_ sets."
@@ -13768,7 +14247,9 @@
msgid ""
"`symmetric_difference`: get all the elements that are in one set or the "
"other, but _not_ both."
-msgstr "对称差(`symmetric_difference`):获取存在于其中一个集合中,但**不**同时存在于两个集合中的所有元素。"
+msgstr ""
+"对称差(`symmetric_difference`):获取存在于其中一个集合中,但**不**同时存在"
+"于两个集合中的所有元素。"
#: src/std/hash/hashset.md:33
msgid "Try all of these in the following example:"
@@ -13778,8 +14259,7 @@
msgid ""
"// `HashSet::insert()` returns false if\n"
" // there was a value already present.\n"
-msgstr ""
-"// 如果集合中已存在该值,`HashSet::insert()` 将返回 false。\n"
+msgstr "// 如果集合中已存在该值,`HashSet::insert()` 将返回 false。\n"
#: src/std/hash/hashset.md:47
msgid "\"Value 4 is already in set B!\""
@@ -13837,84 +14317,88 @@
#: src/std/hash/hashset.md:73
msgid ""
-"(Examples are adapted from the [documentation.](https://doc.rust-lang.org/std/"
-"collections/struct.HashSet.html#method.difference))"
+"(Examples are adapted from the [documentation.](https://doc.rust-lang.org/"
+"std/collections/struct.HashSet.html#method.difference))"
msgstr ""
-"(示例改编自[官方文档](https://doc.rust-lang.org/std/collections/struct.HashSet.html#method.difference))"
+"(示例改编自[官方文档](https://doc.rust-lang.org/std/collections/"
+"struct.HashSet.html#method.difference))"
#: src/std/rc.md:3
msgid ""
-"When multiple ownership is needed, `Rc`(Reference Counting) can be used. `Rc` "
-"keeps track of the number of the references which means the number of owners "
-"of the value wrapped inside an `Rc`."
+"When multiple ownership is needed, `Rc`(Reference Counting) can be used. "
+"`Rc` keeps track of the number of the references which means the number of "
+"owners of the value wrapped inside an `Rc`."
msgstr ""
-"当需要多重所有权时,可以使用 `Rc`(引用计数,Reference Counting)。`Rc` 会跟踪引用的数量,即包裹在 `Rc` 内部的值的所有者数量。"
+"当需要多重所有权时,可以使用 `Rc`(引用计数,Reference Counting)。`Rc` 会跟"
+"踪引用的数量,即包裹在 `Rc` 内部的值的所有者数量。"
-#: src/std/rc.md:5
+#: src/std/rc.md:7
msgid ""
"Reference count of an `Rc` increases by 1 whenever an `Rc` is cloned, and "
"decreases by 1 whenever one cloned `Rc` is dropped out of the scope. When an "
"`Rc`'s reference count becomes zero (which means there are no remaining "
"owners), both the `Rc` and the value are all dropped."
msgstr ""
-"每当克隆一个 `Rc` 时,其引用计数就会增加 1;每当一个克隆的 `Rc` 离开作用域时,引用计数就会减少 1。当 `Rc` 的引用计数变为零(意味着没有剩余的所有者)时,`Rc` 及其包含的值都会被丢弃。"
+"每当克隆一个 `Rc` 时,其引用计数就会增加 1;每当一个克隆的 `Rc` 离开作用域"
+"时,引用计数就会减少 1。当 `Rc` 的引用计数变为零(意味着没有剩余的所有者)"
+"时,`Rc` 及其包含的值都会被丢弃。"
-#: src/std/rc.md:7
+#: src/std/rc.md:12
msgid ""
"Cloning an `Rc` never performs a deep copy. Cloning creates just another "
"pointer to the wrapped value, and increments the count."
msgstr ""
"克隆 `Rc` 从不执行深拷贝。克隆只是创建另一个指向被包裹值的指针,并增加计数。"
-#: src/std/rc.md:13
+#: src/std/rc.md:19
msgid "\"Rc examples\""
msgstr "\"Rc 示例\""
-#: src/std/rc.md:15
+#: src/std/rc.md:21
msgid "\"--- rc_a is created ---\""
msgstr "\"--- rc_a 已创建 ---\""
-#: src/std/rc.md:18 src/std/rc.md:25 src/std/rc.md:37
+#: src/std/rc.md:24 src/std/rc.md:31 src/std/rc.md:43
msgid "\"Reference Count of rc_a: {}\""
msgstr "\"rc_a 的引用计数:{}\""
-#: src/std/rc.md:21
+#: src/std/rc.md:27
msgid "\"--- rc_a is cloned to rc_b ---\""
msgstr "\"--- rc_a 被克隆为 rc_b ---\""
-#: src/std/rc.md:24
+#: src/std/rc.md:30
msgid "\"Reference Count of rc_b: {}\""
msgstr "\"rc_b 的引用计数:{}\""
-#: src/std/rc.md:27
+#: src/std/rc.md:33
msgid "// Two `Rc`s are equal if their inner values are equal\n"
msgstr "// 两个 `Rc` 如果内部值相等,则它们相等\n"
-#: src/std/rc.md:28
+#: src/std/rc.md:34
msgid "\"rc_a and rc_b are equal: {}\""
msgstr "\"rc_a 和 rc_b 是否相等:{}\""
-#: src/std/rc.md:30
+#: src/std/rc.md:36
msgid "// We can use methods of a value directly\n"
msgstr "// 我们可以直接使用值的方法\n"
-#: src/std/rc.md:31
+#: src/std/rc.md:37
msgid "\"Length of the value inside rc_a: {}\""
msgstr "\"rc_a 内部值的长度:{}\""
-#: src/std/rc.md:32
+#: src/std/rc.md:38
msgid "\"Value of rc_b: {}\""
msgstr "\"rc_b 的值:{}\""
-#: src/std/rc.md:34
+#: src/std/rc.md:40
msgid "\"--- rc_b is dropped out of scope ---\""
msgstr "\"--- rc_b 超出作用域被释放 ---\""
-#: src/std/rc.md:39
+#: src/std/rc.md:45
msgid "\"--- rc_a is dropped out of scope ---\""
msgstr "\"--- rc_a 超出作用域被释放 ---\""
-#: src/std/rc.md:42
+#: src/std/rc.md:48
msgid ""
"// Error! `rc_examples` already moved into `rc_a`\n"
" // And when `rc_a` is dropped, `rc_examples` is dropped together\n"
@@ -13926,13 +14410,13 @@
" // println!(\"rc_examples: {}\", rc_examples);\n"
" // TODO:尝试取消注释上面这行\n"
-#: src/std/rc.md:51
+#: src/std/rc.md:57
msgid ""
"[std::rc](https://doc.rust-lang.org/std/rc/index.html) and [std::sync::arc]"
"(https://doc.rust-lang.org/std/sync/struct.Arc.html)."
msgstr ""
-"[`std::rc`](https://doc.rust-lang.org/std/rc/index.html) 和 [`std::sync::arc`]"
-"(https://doc.rust-lang.org/std/sync/struct.Arc.html)。"
+"[`std::rc`](https://doc.rust-lang.org/std/rc/index.html) 和 "
+"[`std::sync::arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html)。"
#: src/std/arc.md:1
msgid "Arc"
@@ -13947,10 +14431,10 @@
"when the last reference pointer to a value is out of scope, the variable is "
"dropped."
msgstr ""
-"当需要在线程间共享所有权时,可以使用 `Arc`(原子引用计数,Atomically Reference "
-"Counted)。通过 `Clone` 实现,这个结构体可以为堆内存中值的位置创建一个引用指针,"
-"同时增加引用计数。由于它在线程间共享所有权,当指向某个值的最后一个引用指针超出"
-"作用域时,该变量就会被释放。"
+"当需要在线程间共享所有权时,可以使用 `Arc`(原子引用计数,Atomically "
+"Reference Counted)。通过 `Clone` 实现,这个结构体可以为堆内存中值的位置创建"
+"一个引用指针,同时增加引用计数。由于它在线程间共享所有权,当指向某个值的最后"
+"一个引用指针超出作用域时,该变量就会被释放。"
#: src/std/arc.md:15
msgid "// This variable declaration is where its value is specified.\n"
@@ -13964,15 +14448,13 @@
msgid ""
"// Here there is no value specification as it is a pointer to a\n"
" // reference in the memory heap.\n"
-msgstr ""
-"// 这里没有指定值,因为它是指向堆内存中引用的指针。\n"
+msgstr "// 这里没有指定值,因为它是指向堆内存中引用的指针。\n"
#: src/std/arc.md:24
msgid ""
"// As Arc was used, threads can be spawned using the value allocated\n"
" // in the Arc variable pointer's location.\n"
-msgstr ""
-"// 由于使用了 Arc,可以使用 Arc 变量指针所指向的值来生成线程。\n"
+msgstr "// 由于使用了 Arc,可以使用 Arc 变量指针所指向的值来生成线程。\n"
#: src/std/arc.md:30
msgid "// Make sure all Arc instances are printed from spawned threads.\n"
@@ -13992,7 +14474,8 @@
"Rust provides a mechanism for spawning native OS threads via the `spawn` "
"function, the argument of this function is a moving closure."
msgstr ""
-"Rust 通过 `spawn` 函数提供了一种生成原生操作系统线程的机制,该函数的参数是一个移动闭包。"
+"Rust 通过 `spawn` 函数提供了一种生成原生操作系统线程的机制,该函数的参数是一"
+"个移动闭包。"
#: src/std_misc/threads.md:10 src/std_misc/threads/testcase_mapreduce.md:28
msgid "// This is the `main` thread\n"
@@ -14020,10 +14503,9 @@
#: src/std_misc/threads/testcase_mapreduce.md:3
msgid ""
-"Rust makes it very easy to parallelise data processing, without many of the "
+"Rust makes it very easy to parallelize data processing, without many of the "
"headaches traditionally associated with such an attempt."
-msgstr ""
-"Rust 使并行数据处理变得非常简单,避免了传统并行处理中常见的诸多问题。"
+msgstr "Rust 使并行数据处理变得非常简单,避免了传统并行处理中常见的诸多问题。"
#: src/std_misc/threads/testcase_mapreduce.md:5
msgid ""
@@ -14031,25 +14513,29 @@
"These, combined with Rust's concept of Ownership and aliasing rules, "
"automatically prevent data races."
msgstr ""
-"标准库提供了开箱即用的优秀线程原语。这些原语结合 Rust 的所有权概念和别名规则,自动防止了数据竞争。"
+"标准库提供了开箱即用的优秀线程原语。这些原语结合 Rust 的所有权概念和别名规"
+"则,自动防止了数据竞争。"
#: src/std_misc/threads/testcase_mapreduce.md:9
msgid ""
"The aliasing rules (one writable reference XOR many readable references) "
"automatically prevent you from manipulating state that is visible to other "
-"threads. (Where synchronisation is needed, there are synchronisation "
+"threads. (Where synchronization is needed, there are synchronization "
"primitives like `Mutex`es or `Channel`s.)"
msgstr ""
-"别名规则(一个可写引用或多个可读引用)自动防止你操作对其他线程可见的状态。(在需要同步的情况下,可以使用 `Mutex` 或 `Channel` 等同步原语。)"
+"别名规则(一个可写引用异或多个可读引用)自动防止你操作对其他线程可见的状态。"
+"(在需要同步的情况下,可以使用 `Mutex` 或 `Channel` 等同步原语。)"
#: src/std_misc/threads/testcase_mapreduce.md:14
msgid ""
"In this example, we will calculate the sum of all digits in a block of "
-"numbers. We will do this by parcelling out chunks of the block into different "
-"threads. Each thread will sum its tiny block of digits, and subsequently we "
-"will sum the intermediate sums produced by each thread."
+"numbers. We will do this by parcelling out chunks of the block into "
+"different threads. Each thread will sum its tiny block of digits, and "
+"subsequently we will sum the intermediate sums produced by each thread."
msgstr ""
-"在这个例子中,我们将计算一个数字块中所有数字的总和。我们通过将数字块分成小块并分配给不同的线程来完成这个任务。每个线程将计算其小块数字的总和,随后我们将汇总每个线程产生的中间结果。"
+"在这个例子中,我们将计算一个数字块中所有数字的总和。我们通过将数字块分成小块"
+"并分配给不同的线程来完成这个任务。每个线程将计算其小块数字的总和,随后我们将"
+"汇总每个线程产生的中间结果。"
#: src/std_misc/threads/testcase_mapreduce.md:19
msgid ""
@@ -14058,10 +14544,13 @@
"unsafety or data races can occur. Also because the references we're passing "
"have `'static` lifetimes, Rust understands that our data won't be destroyed "
"while these threads are still running. (When you need to share non-`static` "
-"data between threads, you can use a smart pointer like `Arc` to keep the data "
-"alive and avoid non-`static` lifetimes.)"
+"data between threads, you can use a smart pointer like `Arc` to keep the "
+"data alive and avoid non-`static` lifetimes.)"
msgstr ""
-"注意,尽管我们在线程间传递引用,但 Rust 理解我们只是传递只读引用,因此不会发生不安全操作或数据竞争。此外,由于我们传递的引用具有 `'static` 生命周期,Rust 确保这些线程运行时数据不会被销毁。(当需要在线程间共享非 `static` 数据时,可以使用 `Arc` 等智能指针来保持数据存活并避免非 `static` 生命周期。)"
+"注意,尽管我们在线程间传递引用,但 Rust 理解我们只是传递只读引用,因此不会发"
+"生不安全操作或数据竞争。此外,由于我们传递的引用具有 `'static` 生命周期,"
+"Rust 确保这些线程运行时数据不会被销毁。(当需要在线程间共享非 `static` 数据"
+"时,可以使用 `Arc` 等智能指针来保持数据存活并避免非 `static` 生命周期。)"
#: src/std_misc/threads/testcase_mapreduce.md:32
msgid ""
@@ -14112,7 +14601,7 @@
" ************************************************************************/"
msgstr ""
"/*************************************************************************\n"
-" * "Map"阶段\n"
+" * \"Map\"阶段\n"
" *\n"
" * 将数据分割成多个段,并进行初步处理\n"
" ************************************************************************/"
@@ -14136,13 +14625,13 @@
msgstr ""
"// 遍历数据段\n"
" // .enumerate() 为迭代的每个元素添加当前循环索引\n"
-" // 生成的元组"(索引, 元素)"随后立即通过\n"
-" // "解构赋值"被"解构"为两个变量:"i"和"data_segment"\n"
+" // 生成的元组\"(索引, 元素)\"随后立即通过\n"
+" // \"解构赋值\"被\"解构\"为两个变量:\"i\"和\"data_segment\"\n"
" // \n"
#: src/std_misc/threads/testcase_mapreduce.md:65
msgid "\"data segment {} is \\\"{}\\\"\""
-msgstr "\"数据段 {} 是"{}"\""
+msgstr "\"数据段 {} 是\\\"{}\\\"\""
#: src/std_misc/threads/testcase_mapreduce.md:67
msgid ""
@@ -14210,7 +14699,7 @@
" // last evaluated expression in each block is automatically its "
"value.\n"
msgstr ""
-"// 不需要使用 \"return\",因为 Rust 是一种"表达式语言",\n"
+"// 不需要使用 \"return\",因为 Rust 是一种\"表达式语言\",\n"
"// 每个代码块中最后求值的表达式会自动成为该块的返回值。\n"
#: src/std_misc/threads/testcase_mapreduce.md:102
@@ -14252,7 +14741,7 @@
msgid "Assignments"
msgstr "练习"
-#: src/std_misc/threads/testcase_mapreduce.md:123
+#: src/std_misc/threads/testcase_mapreduce.md:124
msgid ""
"It is not wise to let our number of threads depend on user inputted data. "
"What if the user decides to insert a lot of spaces? Do we _really_ want to "
@@ -14260,43 +14749,49 @@
"into a limited number of chunks, defined by a static constant at the "
"beginning of the program."
msgstr ""
-"让线程数量依赖于用户输入的数据并不明智。如果用户决定插入大量空格,我们真的想要创建 2,000 个线程吗?修改程序,使数据始终被分割成固定数量的块,这个数量应由程序开头定义的静态常量来确定。"
+"让线程数量依赖于用户输入的数据并不明智。如果用户决定插入大量空格,我们真的想"
+"要创建 2,000 个线程吗?修改程序,使数据始终被分割成固定数量的块,这个数量应由"
+"程序开头定义的静态常量来确定。"
-#: src/std_misc/threads/testcase_mapreduce.md:129
+#: src/std_misc/threads/testcase_mapreduce.md:131
msgid "[Threads](../threads.md)"
msgstr "[线程](../threads.md)"
-#: src/std_misc/threads/testcase_mapreduce.md:130
+#: src/std_misc/threads/testcase_mapreduce.md:132
msgid "[vectors](../../std/vec.md) and [iterators](../../trait/iter.md)"
msgstr "[向量](../../std/vec.md)和[迭代器](../../trait/iter.md)"
-#: src/std_misc/threads/testcase_mapreduce.md:131
-msgid ""
-"[closures](../../fn/closures.md), [move](../../scope/move.md) semantics and "
-"[`move` closures](https://doc.rust-lang.org/book/ch13-01-closures."
-"html#closures-can-capture-their-environment)"
-msgstr ""
-"[闭包](../../fn/closures.md)、[move](../../scope/move.md) 语义和 [`move` 闭包](https://doc.rust-lang.org/book/ch13-01-closures.html#closures-can-capture-their-environment)"
-
-#: src/std_misc/threads/testcase_mapreduce.md:132
-msgid ""
-"[destructuring](https://doc.rust-lang.org/book/ch18-03-pattern-syntax."
-"html#destructuring-to-break-apart-values) assignments"
-msgstr ""
-"[解构](https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html#destructuring-to-break-apart-values)赋值"
-
#: src/std_misc/threads/testcase_mapreduce.md:133
msgid ""
-"[turbofish notation](https://doc.rust-lang.org/book/appendix-02-operators."
-"html?highlight=turbofish) to help type inference"
+"[closures](../../fn/closures.md), [move](../../scope/move.md) semantics and "
+"[`move` closures](https://doc.rust-lang.org/book/ch13-01-"
+"closures.html#closures-can-capture-their-environment)"
msgstr ""
-"[涡轮鱼符号](https://doc.rust-lang.org/book/appendix-02-operators.html?highlight=turbofish)用于辅助类型推断"
+"[闭包](../../fn/closures.md)、[move](../../scope/move.md) 语义和 [`move` 闭"
+"包](https://doc.rust-lang.org/book/ch13-01-closures.html#closures-can-"
+"capture-their-environment)"
#: src/std_misc/threads/testcase_mapreduce.md:134
+msgid ""
+"[destructuring](https://doc.rust-lang.org/book/ch18-03-pattern-"
+"syntax.html#destructuring-to-break-apart-values) assignments"
+msgstr ""
+"[解构](https://doc.rust-lang.org/book/ch18-03-pattern-"
+"syntax.html#destructuring-to-break-apart-values)赋值"
+
+#: src/std_misc/threads/testcase_mapreduce.md:135
+msgid ""
+"[turbofish notation](https://doc.rust-lang.org/book/appendix-02-"
+"operators.html?highlight=turbofish) to help type inference"
+msgstr ""
+"[涡轮鱼符号](https://doc.rust-lang.org/book/appendix-02-operators.html?"
+"highlight=turbofish)用于辅助类型推断"
+
+#: src/std_misc/threads/testcase_mapreduce.md:136
msgid "[unwrap vs. expect](../../error/option_unwrap.md)"
msgstr "[unwrap 与 expect](../../error/option_unwrap.md)"
-#: src/std_misc/threads/testcase_mapreduce.md:135
+#: src/std_misc/threads/testcase_mapreduce.md:137
msgid "[enumerate](https://doc.rust-lang.org/book/loops.html#enumerate)"
msgstr "[enumerate](https://doc.rust-lang.org/book/loops.html#enumerate)"
@@ -14306,7 +14801,8 @@
"Channels allow a unidirectional flow of information between two end-points: "
"the `Sender` and the `Receiver`."
msgstr ""
-"Rust 提供异步通道(`channels`)用于线程间通信。通道允许信息在两个端点之间单向流动:发送端(`Sender`)和接收端(`Receiver`)。"
+"Rust 提供异步通道(`channels`)用于线程间通信。通道允许信息在两个端点之间单向"
+"流动:发送端(`Sender`)和接收端(`Receiver`)。"
#: src/std_misc/channels.md:15
msgid ""
@@ -14378,22 +14874,28 @@
"`windows::Path`, for Windows. The prelude exports the appropriate platform-"
"specific `Path` variant."
msgstr ""
-"`Path` 结构体表示底层文件系统中的文件路径。`Path` 有两种变体:用于类 UNIX 系统的 `posix::Path` 和用于 Windows 的 `windows::Path`。prelude 会导出适合特定平台的 `Path` 变体。"
+"`Path` 结构体表示底层文件系统中的文件路径。`Path` 有两种变体:用于类 UNIX 系"
+"统的 `posix::Path` 和用于 Windows 的 `windows::Path`。prelude 会导出适合特定"
+"平台的 `Path` 变体。"
#: src/std_misc/path.md:8
msgid ""
"A `Path` can be created from an `OsStr`, and provides several methods to get "
"information from the file/directory the path points to."
msgstr ""
-"`Path` 可以从 `OsStr` 创建,并提供多种方法来获取路径所指向的文件或目录的信息。"
+"`Path` 可以从 `OsStr` 创建,并提供多种方法来获取路径所指向的文件或目录的信"
+"息。"
#: src/std_misc/path.md:11
msgid ""
-"A `Path` is immutable. The owned version of `Path` is `PathBuf`. The relation "
-"between `Path` and `PathBuf` is similar to that of `str` and `String`: a "
-"`PathBuf` can be mutated in-place, and can be dereferenced to a `Path`."
+"A `Path` is immutable. The owned version of `Path` is `PathBuf`. The "
+"relation between `Path` and `PathBuf` is similar to that of `str` and "
+"`String`: a `PathBuf` can be mutated in-place, and can be dereferenced to a "
+"`Path`."
msgstr ""
-"`Path` 是不可变的。`Path` 的所有权版本是 `PathBuf`。`Path` 和 `PathBuf` 之间的关系类似于 `str` 和 `String`:`PathBuf` 可以原地修改,并且可以解引用为 `Path`。"
+"`Path` 是不可变的。`Path` 的所有权版本是 `PathBuf`。`Path` 和 `PathBuf` 之间"
+"的关系类似于 `str` 和 `String`:`PathBuf` 可以原地修改,并且可以解引用为 "
+"`Path`。"
#: src/std_misc/path.md:15
msgid ""
@@ -14403,15 +14905,18 @@
"`Path` can be freely converted to an `OsString` or `&OsStr` using "
"`into_os_string` and `as_os_str`, respectively."
msgstr ""
-"注意,`Path` 在内部**并非**表示为 UTF-8 字符串,而是存储为 `OsString`。因此,将 `Path` 转换为 `&str` **并非**零开销操作,且可能失败(返回一个 `Option`)。然而,`Path` 可以自由地转换为 `OsString` 或 `&OsStr`,分别使用 `into_os_string` 和 `as_os_str` 方法。"
+"注意,`Path` 在内部**并非**表示为 UTF-8 字符串,而是存储为 `OsString`。因此,"
+"将 `Path` 转换为 `&str` **并非**零开销操作,且可能失败(返回一个 `Option`)。"
+"然而,`Path` 可以自由地转换为 `OsString` 或 `&OsStr`,分别使用 "
+"`into_os_string` 和 `as_os_str` 方法。"
#: src/std_misc/path.md:25
msgid "// Create a `Path` from an `&'static str`\n"
msgstr "// 从 `&'static str` 创建一个 `Path`\n"
#: src/std_misc/path.md:26
-msgid "\".\""
-msgstr "\".\""
+msgid "\".\""
+msgstr "\".\""
#: src/std_misc/path.md:28
msgid "// The `display` method returns a `Display`able structure\n"
@@ -14458,7 +14963,8 @@
"Be sure to check at other `Path` methods (`posix::Path` or `windows::Path`) "
"and the `Metadata` struct."
msgstr ""
-"请务必查看其他 `Path` 方法(`posix::Path` 或 `windows::Path`)以及 `Metadata` 结构体。"
+"请务必查看其他 `Path` 方法(`posix::Path` 或 `windows::Path`)以及 "
+"`Metadata` 结构体。"
#: src/std_misc/path.md:56
msgid ""
@@ -14473,22 +14979,26 @@
"The `File` struct represents a file that has been opened (it wraps a file "
"descriptor), and gives read and/or write access to the underlying file."
msgstr ""
-"`File` 结构体表示一个已打开的文件(它封装了一个文件描述符),并提供对底层文件的读取和/或写入访问。"
+"`File` 结构体表示一个已打开的文件(它封装了一个文件描述符),并提供对底层文件"
+"的读取和/或写入访问。"
#: src/std_misc/file.md:6
msgid ""
"Since many things can go wrong when doing file I/O, all the `File` methods "
-"return the `io::Result<T>` type, which is an alias for `Result<T, io::Error>`."
+"return the `io::Result<T>` type, which is an alias for `Result<T, "
+"io::Error>`."
msgstr ""
-"由于文件 I/O 操作可能会出现多种错误,所有 `File` 方法都返回 `io::Result<T>` 类型,这是 `Result<T, io::Error>` 的别名。"
+"由于文件 I/O 操作可能会出现多种错误,所有 `File` 方法都返回 `io::Result<T>` "
+"类型,这是 `Result<T, io::Error>` 的别名。"
#: src/std_misc/file.md:9
msgid ""
"This makes the failure of all I/O operations _explicit_. Thanks to this, the "
-"programmer can see all the failure paths, and is encouraged to handle them in "
-"a proactive manner."
+"programmer can see all the failure paths, and is encouraged to handle them "
+"in a proactive manner."
msgstr ""
-"这使得所有 I/O 操作的失败都变得**显式**。得益于此,程序员可以看到所有可能的失败路径,并被鼓励主动处理这些情况。"
+"这使得所有 I/O 操作的失败都变得**显式**。得益于此,程序员可以看到所有可能的失"
+"败路径,并被鼓励主动处理这些情况。"
#: src/std_misc/file/open.md:3
msgid "The `open` function can be used to open a file in read-only mode."
@@ -14498,8 +15008,7 @@
msgid ""
"A `File` owns a resource, the file descriptor and takes care of closing the "
"file when it is `drop`ed."
-msgstr ""
-"`File` 拥有一个资源(即文件描述符),并在被 `drop` 时负责关闭文件。"
+msgstr "`File` 拥有一个资源(即文件描述符),并在被 `drop` 时负责关闭文件。"
#: src/std_misc/file/open.md:14
msgid "// Create a path to the desired file\n"
@@ -14559,19 +15068,22 @@
"(You are encouraged to test the previous example under different failure "
"conditions: `hello.txt` doesn't exist, or `hello.txt` is not readable, etc.)"
msgstr ""
-"(建议您在不同的失败情况下测试上述示例:例如 `hello.txt` 不存在,或 `hello.txt` 不可读等。)"
+"(建议您在不同的失败情况下测试上述示例:例如 `hello.txt` 不存在,或 "
+"`hello.txt` 不可读等。)"
#: src/std_misc/file/create.md:3
msgid ""
"The `create` function opens a file in write-only mode. If the file already "
"existed, the old content is destroyed. Otherwise, a new file is created."
msgstr ""
-"`create` 函数以只写模式打开文件。如果文件已存在,旧内容会被清除;否则,会创建一个新文件。"
+"`create` 函数以只写模式打开文件。如果文件已存在,旧内容会被清除;否则,会创建"
+"一个新文件。"
#: src/std_misc/file/create.md:9
msgid ""
"\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n"
-"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,\n"
+"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
+"veniam,\n"
"quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\n"
"consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse\n"
"cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat "
@@ -14580,7 +15092,8 @@
"\""
msgstr ""
"\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n"
-"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,\n"
+"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
+"veniam,\n"
"quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\n"
"consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse\n"
"cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat "
@@ -14612,20 +15125,20 @@
msgid "\"successfully wrote to {}\""
msgstr "\"成功写入 {}\""
-#: src/std_misc/file/create.md:53
+#: src/std_misc/file/create.md:54
msgid ""
"(As in the previous example, you are encouraged to test this example under "
"failure conditions.)"
-msgstr ""
-"(与前面的示例类似,建议您在失败情况下测试此示例。)"
+msgstr "(与前面的示例类似,建议您在失败情况下测试此示例。)"
-#: src/std_misc/file/create.md:56
+#: src/std_misc/file/create.md:57
msgid ""
-"The [`OpenOptions`](https://doc.rust-lang.org/std/fs/struct.OpenOptions.html) "
-"struct can be used to configure how a file is opened."
+"The [`OpenOptions`](https://doc.rust-lang.org/std/fs/"
+"struct.OpenOptions.html) struct can be used to configure how a file is "
+"opened."
msgstr ""
-"[`OpenOptions`](https://doc.rust-lang.org/std/fs/struct.OpenOptions.html) "
-"结构体可用于配置文件的打开方式。"
+"[`OpenOptions`](https://doc.rust-lang.org/std/fs/struct.OpenOptions.html) 结"
+"构体可用于配置文件的打开方式。"
#: src/std_misc/file/read_lines.md:3
msgid "A naive approach"
@@ -14635,16 +15148,16 @@
msgid ""
"This might be a reasonable first attempt for a beginner's first "
"implementation for reading lines from a file."
-msgstr ""
-"对于初学者来说,这可能是从文件中读取行的一个合理的初步尝试。"
+msgstr "对于初学者来说,这可能是从文件中读取行的一个合理的初步尝试。"
#: src/std_misc/file/read_lines.md:22
msgid ""
-"Since the method `lines()` returns an iterator over the lines in the file, we "
-"can also perform a map inline and collect the results, yielding a more "
+"Since the method `lines()` returns an iterator over the lines in the file, "
+"we can also perform a map inline and collect the results, yielding a more "
"concise and fluent expression."
msgstr ""
-"由于 `lines()` 方法返回文件中各行的迭代器,我们可以内联执行 map 并收集结果,从而得到一个更简洁流畅的表达式。"
+"由于 `lines()` 方法返回文件中各行的迭代器,我们可以内联执行 map 并收集结果,"
+"从而得到一个更简洁流畅的表达式。"
#: src/std_misc/file/read_lines.md:31
msgid "// panic on possible file-reading errors\n"
@@ -14668,7 +15181,8 @@
"returned from `lines()` to the owned type `String`, using `.to_string()` and "
"`String::from` respectively."
msgstr ""
-"注意,在上述两个示例中,我们都必须将 `lines()` 返回的 `&str` 引用转换为拥有所有权的 `String` 类型,分别使用 `.to_string()` 和 `String::from`。"
+"注意,在上述两个示例中,我们都必须将 `lines()` 返回的 `&str` 引用转换为拥有所"
+"有权的 `String` 类型,分别使用 `.to_string()` 和 `String::from`。"
#: src/std_misc/file/read_lines.md:42
msgid "A more efficient approach"
@@ -14679,14 +15193,16 @@
"Here we pass ownership of the open `File` to a `BufReader` struct. "
"`BufReader` uses an internal buffer to reduce intermediate allocations."
msgstr ""
-"在这里,我们将打开的 `File` 的所有权传递给 `BufReader` 结构体。`BufReader` 使用内部缓冲区来减少中间分配。"
+"在这里,我们将打开的 `File` 的所有权传递给 `BufReader` 结构体。`BufReader` 使"
+"用内部缓冲区来减少中间分配。"
#: src/std_misc/file/read_lines.md:47
msgid ""
"We also update `read_lines` to return an iterator instead of allocating new "
"`String` objects in memory for each line."
msgstr ""
-"我们还对 `read_lines` 函数进行了改进,使其返回一个迭代器,而不是为每行内容在内存中分配新的 `String` 对象。"
+"我们还对 `read_lines` 函数进行了改进,使其返回一个迭代器,而不是为每行内容在"
+"内存中分配新的 `String` 对象。"
#: src/std_misc/file/read_lines.md:56
msgid "// File hosts.txt must exist in the current path\n"
@@ -14712,7 +15228,7 @@
msgid "Running this program simply prints the lines individually."
msgstr "运行此程序将逐行打印文件内容。"
-#: src/std_misc/file/read_lines.md:75
+#: src/std_misc/file/read_lines.md:76
msgid ""
"```shell\n"
"$ echo -e \"127.0.0.1\\n192.168.0.1\\n\" > hosts.txt\n"
@@ -14728,28 +15244,31 @@
"192.168.0.1\n"
"```"
-#: src/std_misc/file/read_lines.md:82
+#: src/std_misc/file/read_lines.md:83
msgid ""
-"(Note that since `File::open` expects a generic `AsRef<Path>` as argument, we "
-"define our generic `read_lines()` method with the same generic constraint, "
-"using the `where` keyword.)"
+"(Note that since `File::open` expects a generic `AsRef<Path>` as argument, "
+"we define our generic `read_lines()` method with the same generic "
+"constraint, using the `where` keyword.)"
msgstr ""
-"(注意,由于 `File::open` 需要一个泛型 `AsRef<Path>` 作为参数,我们使用 `where` 关键字为 `read_lines()` 方法定义了相同的泛型约束。)"
+"(注意,由于 `File::open` 需要一个泛型 `AsRef<Path>` 作为参数,我们使用 "
+"`where` 关键字为 `read_lines()` 方法定义了相同的泛型约束。)"
-#: src/std_misc/file/read_lines.md:85
+#: src/std_misc/file/read_lines.md:86
msgid ""
-"This process is more efficient than creating a `String` in memory with all of "
-"the file's contents. This can especially cause performance issues when "
+"This process is more efficient than creating a `String` in memory with all "
+"of the file's contents. This can especially cause performance issues when "
"working with larger files."
msgstr ""
-"这种方法比在内存中创建包含整个文件内容的 `String` 更加高效。特别是在处理大文件时,后者可能会导致性能问题。"
+"这种方法比在内存中创建包含整个文件内容的 `String` 更加高效。特别是在处理大文"
+"件时,后者可能会导致性能问题。"
#: src/std_misc/process.md:3
msgid ""
"The `process::Output` struct represents the output of a finished child "
"process, and the `process::Command` struct is a process builder."
msgstr ""
-"`process::Output` 结构体表示已完成子进程的输出,而 `process::Command` 结构体是一个进程构建器。"
+"`process::Output` 结构体表示已完成子进程的输出,而 `process::Command` 结构体"
+"是一个进程构建器。"
#: src/std_misc/process.md:10
msgid "\"rustc\""
@@ -14773,18 +15292,18 @@
#: src/std_misc/process.md:28
msgid ""
-"(You are encouraged to try the previous example with an incorrect flag passed "
-"to `rustc`)"
-msgstr ""
-"(建议您尝试在上述示例中向 `rustc` 传递一个错误的标志)"
+"(You are encouraged to try the previous example with an incorrect flag "
+"passed to `rustc`)"
+msgstr "(建议您尝试在上述示例中向 `rustc` 传递一个错误的标志)"
#: src/std_misc/process/pipe.md:3
msgid ""
-"The `std::Child` struct represents a running child process, and exposes the "
+"The `std::process::Child` struct represents a child process, and exposes the "
"`stdin`, `stdout` and `stderr` handles for interaction with the underlying "
"process via pipes."
msgstr ""
-"`std::Child` 结构体代表一个正在运行的子进程,它暴露了 `stdin`、`stdout` 和 `stderr` 句柄,允许通过管道与底层进程进行交互。"
+"`std::process::Child` 结构体代表一个子进程,它暴露了 `stdin`、`stdout` 和 "
+"`stderr` 句柄,允许通过管道与底层进程进行交互。"
#: src/std_misc/process/pipe.md:11
msgid "\"the quick brown fox jumps over the lazy dog\\n\""
@@ -14858,8 +15377,7 @@
msgid ""
"// The `stdout` field also has type `Option<ChildStdout>` so must be "
"unwrapped.\n"
-msgstr ""
-"// `stdout` 字段的类型也是 `Option<ChildStdout>`,因此必须解包。\n"
+msgstr "// `stdout` 字段的类型也是 `Option<ChildStdout>`,因此必须解包。\n"
#: src/std_misc/process/pipe.md:49
msgid "\"couldn't read wc stdout: {}\""
@@ -14871,10 +15389,11 @@
#: src/std_misc/process/wait.md:3
msgid ""
-"If you'd like to wait for a `process::Child` to finish, you must call `Child::"
-"wait`, which will return a `process::ExitStatus`."
+"If you'd like to wait for a `process::Child` to finish, you must call "
+"`Child::wait`, which will return a `process::ExitStatus`."
msgstr ""
-"如果你想等待一个 `process::Child` 完成,你必须调用 `Child::wait`,它会返回一个 `process::ExitStatus`。"
+"如果你想等待一个 `process::Child` 完成,你必须调用 `Child::wait`,它会返回一"
+"个 `process::ExitStatus`。"
#: src/std_misc/process/wait.md:10
msgid "\"sleep\""
@@ -14887,14 +15406,13 @@
#: src/std_misc/process/wait.md:18
msgid ""
"# `wait` keeps running for 5 seconds until the `sleep 5` command finishes\n"
-msgstr ""
-"# `wait` 会持续运行 5 秒,直到 `sleep 5` 命令执行完毕\n"
+msgstr "# `wait` 会持续运行 5 秒,直到 `sleep 5` 命令执行完毕\n"
#: src/std_misc/fs.md:3
msgid ""
-"The `std::fs` module contains several functions that deal with the filesystem."
-msgstr ""
-"`std::fs` 模块包含多个用于处理文件系统的函数。"
+"The `std::fs` module contains several functions that deal with the "
+"filesystem."
+msgstr "`std::fs` 模块包含多个用于处理文件系统的函数。"
#: src/std_misc/fs.md:10 src/std_misc/fs.md:68 src/std_misc/ffi.md:20
msgid "\"unix\""
@@ -14934,8 +15452,7 @@
#: src/std_misc/fs.md:50
msgid ""
"// The previous match can be simplified using the `unwrap_or_else` method\n"
-msgstr ""
-"// 可以使用 `unwrap_or_else` 方法简化之前的匹配\n"
+msgstr "// 可以使用 `unwrap_or_else` 方法简化之前的匹配\n"
#: src/std_misc/fs.md:51
msgid "\"a/b.txt\""
@@ -15060,7 +15577,8 @@
"The command line arguments can be accessed using `std::env::args`, which "
"returns an iterator that yields a `String` for each argument:"
msgstr ""
-"可以使用 `std::env::args` 访问命令行参数,它返回一个迭代器,为每个参数生成一个 `String`:"
+"可以使用 `std::env::args` 访问命令行参数,它返回一个迭代器,为每个参数生成一"
+"个 `String`:"
#: src/std_misc/arg.md:14
msgid "// The first argument is the path that was used to call the program.\n"
@@ -15100,12 +15618,14 @@
#: src/std_misc/arg.md:32
msgid ""
-"Alternatively, there are numerous crates that can provide extra functionality "
-"when creating command-line applications. One of the more popular command line "
-"argument crates being [`clap`](https://rust-cli.github.io/book/tutorial/cli-"
-"args.html#parsing-cli-arguments-with-clap)."
+"Alternatively, there are numerous crates that can provide extra "
+"functionality when creating command-line applications. One of the more "
+"popular command line argument crates being [`clap`](https://rust-"
+"cli.github.io/book/tutorial/cli-args.html#parsing-cli-arguments-with-clap)."
msgstr ""
-"此外,在开发命令行应用程序时,还有许多 crate 可以提供额外的功能。其中,[`clap`](https://rust-cli.github.io/book/tutorial/cli-args.html#parsing-cli-arguments-with-clap) 是一个广受欢迎的命令行参数处理 crate。"
+"此外,在开发命令行应用程序时,还有许多 crate 可以提供额外的功能。其中,"
+"[`clap`](https://rust-cli.github.io/book/tutorial/cli-args.html#parsing-cli-"
+"arguments-with-clap) 是一个广受欢迎的命令行参数处理 crate。"
#: src/std_misc/arg/matching.md:3
msgid "Matching can be used to parse simple arguments:"
@@ -15186,7 +15706,8 @@
"If you named your program `match_args.rs` and compile it like this `rustc "
"match_args.rs`, you can execute it as follows:"
msgstr ""
-"如果你将程序命名为 `match_args.rs` 并使用 `rustc match_args.rs` 编译它,你可以按以下方式执行:"
+"如果你将程序命名为 `match_args.rs` 并使用 `rustc match_args.rs` 编译它,你可"
+"以按以下方式执行:"
#: src/std_misc/ffi.md:3
msgid ""
@@ -15194,7 +15715,8 @@
"functions must be declared inside an `extern` block annotated with a "
"`#[link]` attribute containing the name of the foreign library."
msgstr ""
-"Rust 提供了与 C 库交互的外部函数接口(FFI)。外部函数必须在 `extern` 块内声明,并使用 `#[link]` 属性标注外部库的名称。"
+"Rust 提供了与 C 库交互的外部函数接口(FFI)。外部函数必须在 `extern` 块内声"
+"明,并使用 `#[link]` 属性标注外部库的名称。"
#: src/std_misc/ffi.md:9
msgid "// this extern block links to the libm library\n"
@@ -15260,8 +15782,7 @@
msgid ""
"Rust is a programming language that cares a lot about correctness and it "
"includes support for writing software tests within the language itself."
-msgstr ""
-"Rust 是一种非常注重正确性的编程语言,它内置了编写软件测试的支持。"
+msgstr "Rust 是一种非常注重正确性的编程语言,它内置了编写软件测试的支持。"
#: src/testing.md:6
msgid "Testing comes in three styles:"
@@ -15292,23 +15813,26 @@
"[The Book](https://doc.rust-lang.org/book/ch11-00-testing.html) chapter on "
"testing"
msgstr ""
-"《Rust 程序设计语言》中[关于测试的章节](https://doc.rust-lang.org/book/ch11-00-testing.html)"
+"《Rust 程序设计语言》中[关于测试的章节](https://doc.rust-lang.org/book/"
+"ch11-00-testing.html)"
#: src/testing.md:19
msgid ""
"[API Guidelines](https://rust-lang-nursery.github.io/api-guidelines/"
"documentation.html) on doc-testing"
msgstr ""
-"API 指南中[关于文档测试的内容](https://rust-lang-nursery.github.io/api-guidelines/documentation.html)"
+"API 指南中[关于文档测试的内容](https://rust-lang-nursery.github.io/api-"
+"guidelines/documentation.html)"
#: src/testing/unit_testing.md:3
msgid ""
-"Tests are Rust functions that verify that the non-test code is functioning in "
-"the expected manner. The bodies of test functions typically perform some "
-"setup, run the code we want to test, then assert whether the results are what "
-"we expect."
+"Tests are Rust functions that verify that the non-test code is functioning "
+"in the expected manner. The bodies of test functions typically perform some "
+"setup, run the code we want to test, then assert whether the results are "
+"what we expect."
msgstr ""
-"测试是 Rust 函数,用于验证非测试代码是否按预期方式运行。测试函数的主体通常包括一些准备工作,运行待测试的代码,然后断言结果是否符合预期。"
+"测试是 Rust 函数,用于验证非测试代码是否按预期方式运行。测试函数的主体通常包"
+"括一些准备工作,运行待测试的代码,然后断言结果是否符合预期。"
#: src/testing/unit_testing.md:8
msgid ""
@@ -15316,14 +15840,16 @@
"[attribute](../attribute.md). Test functions are marked with the `#[test]` "
"attribute."
msgstr ""
-"大多数单元测试都放在带有 `#[cfg(test)]` [属性](../attribute.md)的 `tests` [模块](../mod.md)中。测试函数用 `#[test]` 属性标记。"
+"大多数单元测试都放在带有 `#[cfg(test)]` [属性](../attribute.md)的 `tests` [模"
+"块](../mod.md)中。测试函数用 `#[test]` 属性标记。"
#: src/testing/unit_testing.md:11
msgid ""
"Tests fail when something in the test function [panics](../std/panic.md). "
"There are some helper [macros](../macros.md):"
msgstr ""
-"当测试函数中出现[恐慌(panic)](../std/panic.md)时,测试就会失败。以下是一些辅助[宏](../macros.md):"
+"当测试函数中出现[恐慌(panic)](../std/panic.md)时,测试就会失败。以下是一些"
+"辅助[宏](../macros.md):"
#: src/testing/unit_testing.md:14
msgid "`assert!(expression)` - panics if expression evaluates to `false`."
@@ -15334,18 +15860,19 @@
"`assert_eq!(left, right)` and `assert_ne!(left, right)` - testing left and "
"right expressions for equality and inequality respectively."
msgstr ""
-"`assert_eq!(left, right)` 和 `assert_ne!(left, right)` - 分别用于测试左右表达式的相等性和不相等性。"
+"`assert_eq!(left, right)` 和 `assert_ne!(left, right)` - 分别用于测试左右表达"
+"式的相等性和不相等性。"
#: src/testing/unit_testing.md:22
msgid ""
"// This is a really bad adding function, its purpose is to fail in this\n"
"// example.\n"
-msgstr ""
-"// 这是一个非常糟糕的加法函数,它的目的是在这个例子中失败。\n"
+msgstr "// 这是一个非常糟糕的加法函数,它的目的是在这个例子中失败。\n"
#: src/testing/unit_testing.md:32
msgid ""
-"// Note this useful idiom: importing names from outer (for mod tests) scope.\n"
+"// Note this useful idiom: importing names from outer (for mod tests) "
+"scope.\n"
msgstr ""
"// 注意这个有用的惯用法:从外部作用域(对于 mod tests 而言)导入名称。\n"
@@ -15365,88 +15892,110 @@
msgid "Tests and `?`"
msgstr "测试与 `?` 运算符"
-#: src/testing/unit_testing.md:74
+#: src/testing/unit_testing.md:75
msgid ""
"None of the previous unit test examples had a return type. But in Rust 2018, "
-"your unit tests can return `Result<()>`, which lets you use `?` in them! This "
-"can make them much more concise."
+"your unit tests can return `Result<()>`, which lets you use `?` in them! "
+"This can make them much more concise."
msgstr ""
-"之前的单元测试示例都没有返回类型。但在 Rust 2018 版本中,你的单元测试可以返回 `Result<()>`,这使得你可以在测试中使用 `?` 运算符!这可以使测试代码更加简洁。"
+"之前的单元测试示例都没有返回类型。但在 Rust 2018 版本中,你的单元测试可以返"
+"回 `Result<()>`,这使得你可以在测试中使用 `?` 运算符!这可以使测试代码更加简"
+"洁。"
-#: src/testing/unit_testing.md:83
+#: src/testing/unit_testing.md:84
msgid "\"negative floats don't have square roots\""
msgstr "\"负浮点数没有平方根\""
-#: src/testing/unit_testing.md:100
+#: src/testing/unit_testing.md:101
msgid ""
-"See [\"The Edition Guide\"](https://doc.rust-lang.org/edition-guide/rust-2018/"
-"error-handling-and-panics/question-mark-in-main-and-tests.html) for more "
-"details."
+"See [\"The Edition Guide\"](https://doc.rust-lang.org/edition-guide/"
+"rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.html) "
+"for more details."
msgstr ""
-"更多详情请参阅[《版本指南》](https://doc.rust-lang.org/edition-guide/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.html)。"
+"更多详情请参阅[《版本指南》](https://doc.rust-lang.org/edition-guide/"
+"rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.html)。"
-#: src/testing/unit_testing.md:102
+#: src/testing/unit_testing.md:103
msgid "Testing panics"
msgstr "测试 panic"
-#: src/testing/unit_testing.md:104
+#: src/testing/unit_testing.md:105
msgid ""
"To check functions that should panic under certain circumstances, use "
"attribute `#[should_panic]`. This attribute accepts optional parameter "
"`expected = ` with the text of the panic message. If your function can panic "
"in multiple ways, it helps make sure your test is testing the correct panic."
msgstr ""
-"要检查在某些情况下应该触发恐慌的函数,可以使用 `#[should_panic]` 属性。这个属性接受可选参数 `expected = `,用于指定预期的恐慌消息文本。如果你的函数可能以多种方式触发 panic,这有助于确保你的测试正在检查正确的 panic 情况。"
+"要检查在某些情况下应该触发恐慌的函数,可以使用 `#[should_panic]` 属性。这个属"
+"性接受可选参数 `expected = `,用于指定预期的恐慌消息文本。如果你的函数可能以"
+"多种方式触发 panic,这有助于确保你的测试正在检查正确的 panic 情况。"
-#: src/testing/unit_testing.md:112 src/testing/doc_testing.md:45
+#: src/testing/unit_testing.md:110
+msgid ""
+"**Note**: Rust also allows a shorthand form `#[should_panic = \"message\"]`, "
+"which works exactly like `#[should_panic(expected = \"message\")]`. Both are "
+"valid; the latter is more commonly used and is considered more explicit."
+msgstr ""
+"**注意**:Rust 还允许使用简写形式 `#[should_panic = \"message\"]`,其功能与 "
+"`#[should_panic(expected = \"message\")]` 完全相同。两种形式都有效;后者更常"
+"用,被认为更明确。"
+
+#: src/testing/unit_testing.md:117 src/testing/doc_testing.md:46
msgid "\"Divide-by-zero error\""
msgstr "\"除以零错误\""
-#: src/testing/unit_testing.md:114 src/testing/unit_testing.md:135
+#: src/testing/unit_testing.md:119 src/testing/unit_testing.md:140
+#: src/testing/unit_testing.md:146
msgid "\"Divide result is zero\""
msgstr "\"除法结果为零\""
-#: src/testing/unit_testing.md:142
+#: src/testing/unit_testing.md:146
+msgid "// This also works\n"
+msgstr "// 这样也可以\n"
+
+#: src/testing/unit_testing.md:153
msgid "Running these tests gives us:"
msgstr "运行这些测试会得到以下结果:"
-#: src/testing/unit_testing.md:161
+#: src/testing/unit_testing.md:173
msgid "Running specific tests"
msgstr "运行特定测试"
-#: src/testing/unit_testing.md:163
+#: src/testing/unit_testing.md:175
msgid ""
"To run specific tests one may specify the test name to `cargo test` command."
-msgstr ""
-"要运行特定的测试,可以在 `cargo test` 命令中指定测试名称。"
+msgstr "要运行特定的测试,可以在 `cargo test` 命令中指定测试名称。"
-#: src/testing/unit_testing.md:179
+#: src/testing/unit_testing.md:191
msgid ""
"To run multiple tests one may specify part of a test name that matches all "
"the tests that should be run."
msgstr ""
"要运行多个测试,可以指定测试名称的一部分,该部分匹配所有应该运行的测试。"
-#: src/testing/unit_testing.md:197
+#: src/testing/unit_testing.md:209
msgid "Ignoring tests"
msgstr "忽略测试"
-#: src/testing/unit_testing.md:199
+#: src/testing/unit_testing.md:211
msgid ""
"Tests can be marked with the `#[ignore]` attribute to exclude some tests. Or "
"to run them with command `cargo test -- --ignored`"
msgstr ""
-"可以使用 `#[ignore]` 属性标记测试以排除某些测试。或者使用命令 `cargo test -- --ignored` 来运行这些被忽略的测试。"
+"可以使用 `#[ignore]` 属性标记测试以排除某些测试。或者使用命令 `cargo test -- "
+"--ignored` 来运行这些被忽略的测试。"
#: src/testing/doc_testing.md:3
msgid ""
"The primary way of documenting a Rust project is through annotating the "
"source code. Documentation comments are written in [CommonMark Markdown "
-"specification](https://commonmark.org/) and support code blocks in them. Rust "
-"takes care about correctness, so these code blocks are compiled and used as "
-"documentation tests."
+"specification](https://commonmark.org/) and support code blocks in them. "
+"Rust takes care about correctness, so these code blocks are compiled and "
+"used as documentation tests."
msgstr ""
-"Rust 项目的主要文档编写方式是通过在源代码中添加注释。文档注释使用 [CommonMark Markdown 规范](https://commonmark.org/)编写,并支持其中的代码块。Rust 注重正确性,因此这些代码块会被编译并用作文档测试。"
+"Rust 项目的主要文档编写方式是通过在源代码中添加注释。文档注释使用 "
+"[CommonMark Markdown 规范](https://commonmark.org/)编写,并支持其中的代码块。"
+"Rust 注重正确性,因此这些代码块会被编译并用作文档测试。"
#: src/testing/doc_testing.md:10
msgid ""
@@ -15454,7 +16003,8 @@
"///\n"
"/// The next lines present detailed documentation. Code blocks start with\n"
"/// triple backquotes and have implicit `fn main()` inside\n"
-"/// and `extern crate <cratename>`. Assume we're testing a `playground` library\n"
+"/// and `extern crate <cratename>`. Assume we're testing a `playground` "
+"library\n"
"/// crate or using the Playground's Test action:\n"
"///\n"
"/// ```\n"
@@ -15473,7 +16023,7 @@
"/// assert_eq!(result, 5);\n"
"/// ```\n"
-#: src/testing/doc_testing.md:23
+#: src/testing/doc_testing.md:24
msgid ""
"/// Usually doc comments may include sections \"Examples\", \"Panics\" and "
"\"Failures\".\n"
@@ -15496,7 +16046,7 @@
"/// playground::div(10, 0);\n"
"/// ```\n"
msgstr ""
-"/// 文档注释通常包含"示例"、"异常"和"错误"等部分。\n"
+"/// 文档注释通常包含\"示例\"、\"异常\"和\"错误\"等部分。\n"
"///\n"
"/// 下面的函数用于两数相除。\n"
"///\n"
@@ -15516,39 +16066,44 @@
"/// playground::div(10, 0);\n"
"/// ```\n"
-#: src/testing/doc_testing.md:52
+#: src/testing/doc_testing.md:53
msgid ""
"Code blocks in documentation are automatically tested when running the "
"regular `cargo test` command:"
-msgstr ""
-"运行常规的 `cargo test` 命令时,文档中的代码块会自动进行测试:"
+msgstr "运行常规的 `cargo test` 命令时,文档中的代码块会自动进行测试:"
-#: src/testing/doc_testing.md:71
+#: src/testing/doc_testing.md:72
msgid "Motivation behind documentation tests"
msgstr "文档测试的动机"
-#: src/testing/doc_testing.md:73
+#: src/testing/doc_testing.md:74
msgid ""
-"The main purpose of documentation tests is to serve as examples that exercise "
-"the functionality, which is one of the most important [guidelines](https://"
-"rust-lang-nursery.github.io/api-guidelines/documentation.html#examples-use--"
-"not-try-not-unwrap-c-question-mark). It allows using examples from docs as "
-"complete code snippets. But using `?` makes compilation fail since `main` "
-"returns `unit`. The ability to hide some source lines from documentation "
-"comes to the rescue: one may write `fn try_main() -> Result<(), ErrorType>`, "
-"hide it and `unwrap` it in hidden `main`. Sounds complicated? Here's an "
-"example:"
+"The main purpose of documentation tests is to serve as examples that "
+"exercise the functionality, which is one of the most important [guidelines]"
+"(https://rust-lang-nursery.github.io/api-guidelines/"
+"documentation.html#examples-use--not-try-not-unwrap-c-question-mark). It "
+"allows using examples from docs as complete code snippets. But using `?` "
+"makes compilation fail since `main` returns `unit`. The ability to hide some "
+"source lines from documentation comes to the rescue: one may write `fn "
+"try_main() -> Result<(), ErrorType>`, hide it and `unwrap` it in hidden "
+"`main`. Sounds complicated? Here's an example:"
msgstr ""
-"文档测试的主要目的是提供功能演示的示例,这是最重要的[指导原则](https://rust-lang-nursery.github.io/api-guidelines/documentation.html#examples-use--not-try-not-unwrap-c-question-mark)之一。它允许将文档中的示例作为完整的代码片段使用。但是使用 `?` 会导致编译失败,因为 `main` 函数返回 `unit` 类型。这时,隐藏文档中的某些源代码行就派上用场了:可以编写 `fn try_main() -> Result<(), ErrorType>`,将其隐藏,并在隐藏的 `main` 函数中 `unwrap` 它。听起来很复杂?这里有一个例子:"
+"文档测试的主要目的是提供功能演示的示例,这是最重要的[指导原则](https://rust-"
+"lang-nursery.github.io/api-guidelines/documentation.html#examples-use--not-"
+"try-not-unwrap-c-question-mark)之一。它允许将文档中的示例作为完整的代码片段使"
+"用。但是使用 `?` 会导致编译失败,因为 `main` 函数返回 `unit` 类型。这时,隐藏"
+"文档中的某些源代码行就派上用场了:可以编写 `fn try_main() -> Result<(), "
+"ErrorType>`,将其隐藏,并在隐藏的 `main` 函数中 `unwrap` 它。听起来很复杂?这"
+"里有一个例子:"
-#: src/testing/doc_testing.md:82
+#: src/testing/doc_testing.md:83
msgid ""
"/// Using hidden `try_main` in doc tests.\n"
"///\n"
"/// ```\n"
"/// # // hidden lines start with `#` symbol, but they're still compilable!\n"
-"/// # fn try_main() -> Result<(), String> { // line that wraps the body shown "
-"in doc\n"
+"/// # fn try_main() -> Result<(), String> { // line that wraps the body "
+"shown in doc\n"
"/// let res = playground::try_div(10, 2)?;\n"
"/// # Ok(()) // returning from try_main\n"
"/// # }\n"
@@ -15572,23 +16127,25 @@
"/// # }\n"
"/// ```\n"
-#: src/testing/doc_testing.md:97
+#: src/testing/doc_testing.md:98
msgid "\"Divide-by-zero\""
msgstr "\"除以零错误\""
-#: src/testing/doc_testing.md:106
+#: src/testing/doc_testing.md:107
msgid ""
"[RFC505](https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-"
"conventions.md) on documentation style"
msgstr ""
-"关于文档风格的 [RFC505](https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md)"
+"关于文档风格的 [RFC505](https://github.com/rust-lang/rfcs/blob/master/text/"
+"0505-api-comment-conventions.md)"
-#: src/testing/doc_testing.md:107
+#: src/testing/doc_testing.md:108
msgid ""
"[API Guidelines](https://rust-lang-nursery.github.io/api-guidelines/"
"documentation.html) on documentation guidelines"
msgstr ""
-"关于文档指南的 [API 指南](https://rust-lang-nursery.github.io/api-guidelines/documentation.html)"
+"关于文档指南的 [API 指南](https://rust-lang-nursery.github.io/api-guidelines/"
+"documentation.html)"
#: src/testing/integration_testing.md:3
msgid ""
@@ -15598,7 +16155,9 @@
"would. Their purpose is to test that many parts of your library work "
"correctly together."
msgstr ""
-"[单元测试](unit_testing.md)每次只隔离测试一个模块:它们规模小,可以测试私有代码。集成测试则位于 crate 外部,仅使用其公共接口,就像其他代码一样。集成测试的目的是验证库的多个部分能否正确协同工作。"
+"[单元测试](unit_testing.md)每次只隔离测试一个模块:它们规模小,可以测试私有代"
+"码。集成测试则位于 crate 外部,仅使用其公共接口,就像其他代码一样。集成测试的"
+"目的是验证库的多个部分能否正确协同工作。"
#: src/testing/integration_testing.md:8
msgid "Cargo looks for integration tests in `tests` directory next to `src`."
@@ -15626,7 +16185,8 @@
"crate. In order to share some code between integration tests we can make a "
"module with public functions, importing and using it within tests."
msgstr ""
-"`tests` 目录中的每个 Rust 源文件都被编译为独立的 crate。为了在集成测试之间共享代码,我们可以创建一个包含公共函数的模块,然后在测试中导入并使用它。"
+"`tests` 目录中的每个 Rust 源文件都被编译为独立的 crate。为了在集成测试之间共"
+"享代码,我们可以创建一个包含公共函数的模块,然后在测试中导入并使用它。"
#: src/testing/integration_testing.md:54
msgid "File `tests/common/mod.rs`:"
@@ -15658,7 +16218,8 @@
"because the test runner will treat the file as a test crate and try to run "
"tests inside it."
msgstr ""
-"将模块创建为 `tests/common.rs` 也可行,但不推荐,因为测试运行器会将该文件视为测试 crate 并尝试运行其中的测试。"
+"将模块创建为 `tests/common.rs` 也可行,但不推荐,因为测试运行器会将该文件视为"
+"测试 crate 并尝试运行其中的测试。"
#: src/testing/dev_dependencies.md:1
msgid "Development dependencies"
@@ -15671,16 +16232,20 @@
"dependencies]` section. These dependencies are not propagated to other "
"packages which depend on this package."
msgstr ""
-"有时我们需要仅用于测试(或示例、基准测试)的依赖项。这些依赖项添加在 `Cargo.toml` 的 `[dev-dependencies]` 部分。这些依赖项不会传递给依赖于本包的其他包。"
+"有时我们需要仅用于测试(或示例、基准测试)的依赖项。这些依赖项添加在 "
+"`Cargo.toml` 的 `[dev-dependencies]` 部分。这些依赖项不会传递给依赖于本包的其"
+"他包。"
#: src/testing/dev_dependencies.md:8
msgid ""
-"One such example is [`pretty_assertions`](https://docs.rs/"
-"pretty_assertions/1.0.0/pretty_assertions/index.html), which extends standard "
-"`assert_eq!` and `assert_ne!` macros, to provide colorful diff. \n"
+"One such example is [`pretty_assertions`](https://docs.rs/pretty_assertions/"
+"1.0.0/pretty_assertions/index.html), which extends standard `assert_eq!` and "
+"`assert_ne!` macros, to provide colorful diff. \n"
"File `Cargo.toml`:"
msgstr ""
-"例如 [`pretty_assertions`](https://docs.rs/pretty_assertions/1.0.0/pretty_assertions/index.html),它扩展了标准的 `assert_eq!` 和 `assert_ne!` 宏,提供彩色差异对比。 \n"
+"例如 [`pretty_assertions`](https://docs.rs/pretty_assertions/1.0.0/"
+"pretty_assertions/index.html),它扩展了标准的 `assert_eq!` 和 `assert_ne!` "
+"宏,提供彩色差异对比。 \n"
"文件 `Cargo.toml`:"
#: src/testing/dev_dependencies.md:11
@@ -15701,12 +16266,13 @@
msgid "// crate for test-only use. Cannot be used in non-test code.\n"
msgstr "// 仅用于测试的 crate。不能在非测试代码中使用。\n"
-#: src/testing/dev_dependencies.md:37
+#: src/testing/dev_dependencies.md:38
msgid ""
-"[Cargo](http://doc.crates.io/specifying-dependencies.html) docs on specifying "
-"dependencies."
+"[Cargo](http://doc.crates.io/specifying-dependencies.html) docs on "
+"specifying dependencies."
msgstr ""
-"[Cargo 文档](http://doc.crates.io/specifying-dependencies.html)中关于指定依赖项的说明。"
+"[Cargo 文档](http://doc.crates.io/specifying-dependencies.html)中关于指定依赖"
+"项的说明。"
#: src/unsafe.md:3
msgid ""
@@ -15717,7 +16283,10 @@
"put in place by the compiler; specifically, there are four primary things "
"that unsafe is used for:"
msgstr ""
-"作为本节的引言,借用[官方文档](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html)的话说:"应该尽量减少代码库中不安全代码的数量。"牢记这一点,让我们开始吧!Rust 中的不安全标注用于绕过编译器设置的保护机制。具体来说,不安全主要用于以下四个方面:"
+"作为本节的引言,借用[官方文档](https://doc.rust-lang.org/book/ch19-01-unsafe-"
+"rust.html)的话说:\"应该尽量减少代码库中不安全代码的数量。\"牢记这一点,让我"
+"们开始吧!Rust 中的不安全标注用于绕过编译器设置的保护机制。具体来说,不安全主"
+"要用于以下四个方面:"
#: src/unsafe.md:9
msgid "dereferencing raw pointers"
@@ -15725,10 +16294,11 @@
#: src/unsafe.md:10
msgid ""
-"calling functions or methods which are `unsafe` (including calling a function "
-"over FFI, see [a previous chapter](std_misc/ffi.md) of the book)"
+"calling functions or methods which are `unsafe` (including calling a "
+"function over FFI, see [a previous chapter](std_misc/ffi.md) of the book)"
msgstr ""
-"调用被标记为 `unsafe` 的函数或方法(包括通过 FFI 调用函数,参见本书[前面的章节](std_misc/ffi.md))"
+"调用被标记为 `unsafe` 的函数或方法(包括通过 FFI 调用函数,参见本书[前面的章"
+"节](std_misc/ffi.md))"
#: src/unsafe.md:12
msgid "accessing or modifying static mutable variables"
@@ -15742,37 +16312,44 @@
msgid "Raw Pointers"
msgstr "裸指针"
-#: src/unsafe.md:16
+#: src/unsafe.md:17
msgid ""
"Raw pointers `*` and references `&T` function similarly, but references are "
"always safe because they are guaranteed to point to valid data due to the "
"borrow checker. Dereferencing a raw pointer can only be done through an "
"unsafe block."
msgstr ""
-"裸指针 `*` 和引用 `&T` 的功能类似,但引用总是安全的,因为借用检查器保证它们指向有效数据。解引用裸指针只能在 unsafe 块中进行。"
+"裸指针 `*` 和引用 `&T` 的功能类似,但引用总是安全的,因为借用检查器保证它们指"
+"向有效数据。解引用裸指针只能在 unsafe 块中进行。"
-#: src/unsafe.md:31
+#: src/unsafe.md:32
msgid "Calling Unsafe Functions"
msgstr "调用不安全函数"
-#: src/unsafe.md:32
+#: src/unsafe.md:34
msgid ""
"Some functions can be declared as `unsafe`, meaning it is the programmer's "
"responsibility to ensure correctness instead of the compiler's. One example "
-"of this is [`std::slice::from_raw_parts`](https://doc.rust-lang.org/std/slice/"
-"fn.from_raw_parts.html) which will create a slice given a pointer to the "
-"first element and a length."
+"of this is [`std::slice::from_raw_parts`](https://doc.rust-lang.org/std/"
+"slice/fn.from_raw_parts.html) which will create a slice given a pointer to "
+"the first element and a length."
msgstr ""
-"某些函数可以被声明为 `unsafe`,这意味着确保其正确性是程序员的责任,而不是编译器的责任。一个例子是 [`std::slice::from_raw_parts`](https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html),它根据指向第一个元素的指针和长度创建一个切片。"
+"某些函数可以被声明为 `unsafe`,这意味着确保其正确性是程序员的责任,而不是编译"
+"器的责任。一个例子是 [`std::slice::from_raw_parts`](https://doc.rust-"
+"lang.org/std/slice/fn.from_raw_parts.html),它根据指向第一个元素的指针和长度"
+"创建一个切片。"
-#: src/unsafe.md:54
+#: src/unsafe.md:56
msgid ""
-"For `slice::from_raw_parts`, one of the assumptions which _must_ be upheld is "
-"that the pointer passed in points to valid memory and that the memory pointed "
-"to is of the correct type. If these invariants aren't upheld then the "
-"program's behaviour is undefined and there is no knowing what will happen."
+"For `slice::from_raw_parts`, one of the assumptions which _must_ be upheld "
+"is that the pointer passed in points to valid memory and that the memory "
+"pointed to is of the correct type. If these invariants aren't upheld then "
+"the program's behaviour is undefined and there is no knowing what will "
+"happen."
msgstr ""
-"对于 `slice::from_raw_parts`,**必须**遵守的一个假设是:传入的指针指向有效内存,且指向的内存类型正确。如果这些不变量未被遵守,那么程序的行为将是未定义的,无法预知会发生什么。"
+"对于 `slice::from_raw_parts`,**必须**遵守的一个假设是:传入的指针指向有效内"
+"存,且指向的内存类型正确。如果这些不变量未被遵守,那么程序的行为将是未定义"
+"的,无法预知会发生什么。"
#: src/unsafe/asm.md:3
msgid ""
@@ -15783,199 +16360,214 @@
"level hardware primitives, e.g. in kernel code, may also demand this "
"functionality."
msgstr ""
-"Rust 通过 `asm!` 宏提供了内联汇编支持。它可以用于在编译器生成的汇编输出中嵌入手写的汇编代码。通常这不是必需的,但在无法通过其他方式实现所需性能或时序要求时可能会用到。访问底层硬件原语(例如在内核代码中)也可能需要这个功能。"
+"Rust 通过 `asm!` 宏提供了内联汇编支持。它可以用于在编译器生成的汇编输出中嵌入"
+"手写的汇编代码。通常这不是必需的,但在无法通过其他方式实现所需性能或时序要求"
+"时可能会用到。访问底层硬件原语(例如在内核代码中)也可能需要这个功能。"
#: src/unsafe/asm.md:8
msgid ""
"**Note**: the examples here are given in x86/x86-64 assembly, but other "
"architectures are also supported."
-msgstr ""
-"**注意**:这里的示例使用 x86/x86-64 汇编,但也支持其他架构。"
+msgstr "**注意**:这里的示例使用 x86/x86-64 汇编,但也支持其他架构。"
#: src/unsafe/asm.md:10
msgid "Inline assembly is currently supported on the following architectures:"
msgstr "目前支持内联汇编的架构包括:"
-#: src/unsafe/asm.md:11
+#: src/unsafe/asm.md:12
msgid "x86 and x86-64"
msgstr "x86 和 x86-64"
-#: src/unsafe/asm.md:12
+#: src/unsafe/asm.md:13
msgid "ARM"
msgstr "ARM"
-#: src/unsafe/asm.md:13
+#: src/unsafe/asm.md:14
msgid "AArch64"
msgstr "AArch64"
-#: src/unsafe/asm.md:14
+#: src/unsafe/asm.md:15
msgid "RISC-V"
msgstr "RISC-V"
-#: src/unsafe/asm.md:16
+#: src/unsafe/asm.md:17
msgid "Basic usage"
msgstr "基本用法"
-#: src/unsafe/asm.md:18
+#: src/unsafe/asm.md:19
msgid "Let us start with the simplest possible example:"
msgstr "让我们从最简单的例子开始:"
-#: src/unsafe/asm.md:21 src/unsafe/asm.md:41 src/unsafe/asm.md:68
-#: src/unsafe/asm.md:106 src/unsafe/asm.md:123 src/unsafe/asm.md:148
-#: src/unsafe/asm.md:174 src/unsafe/asm.md:195 src/unsafe/asm.md:212
-#: src/unsafe/asm.md:251 src/unsafe/asm.md:287 src/unsafe/asm.md:303
-#: src/unsafe/asm.md:329 src/unsafe/asm.md:367 src/unsafe/asm.md:394
-#: src/unsafe/asm.md:418 src/unsafe/asm.md:456
+#: src/unsafe/asm.md:22 src/unsafe/asm.md:42 src/unsafe/asm.md:69
+#: src/unsafe/asm.md:107 src/unsafe/asm.md:124 src/unsafe/asm.md:149
+#: src/unsafe/asm.md:183 src/unsafe/asm.md:204 src/unsafe/asm.md:221
+#: src/unsafe/asm.md:260 src/unsafe/asm.md:296 src/unsafe/asm.md:312
+#: src/unsafe/asm.md:338 src/unsafe/asm.md:376 src/unsafe/asm.md:403
+#: src/unsafe/asm.md:427 src/unsafe/asm.md:465
msgid "\"x86_64\""
msgstr "\"x86_64\""
-#: src/unsafe/asm.md:25
+#: src/unsafe/asm.md:26
msgid "\"nop\""
msgstr "\"nop\""
-#: src/unsafe/asm.md:30
+#: src/unsafe/asm.md:31
msgid ""
-"This will insert a NOP (no operation) instruction into the assembly generated "
-"by the compiler. Note that all `asm!` invocations have to be inside an "
-"`unsafe` block, as they could insert arbitrary instructions and break various "
-"invariants. The instructions to be inserted are listed in the first argument "
-"of the `asm!` macro as a string literal."
+"This will insert a NOP (no operation) instruction into the assembly "
+"generated by the compiler. Note that all `asm!` invocations have to be "
+"inside an `unsafe` block, as they could insert arbitrary instructions and "
+"break various invariants. The instructions to be inserted are listed in the "
+"first argument of the `asm!` macro as a string literal."
msgstr ""
-"这将在编译器生成的汇编代码中插入一条 NOP(无操作)指令。请注意,所有 `asm!` 调用都必须放在 `unsafe` 块内,因为它们可能插入任意指令并破坏各种不变量。要插入的指令以字符串字面量的形式列在 `asm!` 宏的第一个参数中。"
+"这将在编译器生成的汇编代码中插入一条 NOP(无操作)指令。请注意,所有 `asm!` "
+"调用都必须放在 `unsafe` 块内,因为它们可能插入任意指令并破坏各种不变量。要插"
+"入的指令以字符串字面量的形式列在 `asm!` 宏的第一个参数中。"
-#: src/unsafe/asm.md:35
+#: src/unsafe/asm.md:36
msgid "Inputs and outputs"
msgstr "输入和输出"
-#: src/unsafe/asm.md:37
+#: src/unsafe/asm.md:38
msgid ""
"Now inserting an instruction that does nothing is rather boring. Let us do "
"something that actually acts on data:"
-msgstr ""
-"插入一个什么都不做的指令相当无聊。让我们来做些实际操作数据的事情:"
+msgstr "插入一个什么都不做的指令相当无聊。让我们来做些实际操作数据的事情:"
-#: src/unsafe/asm.md:46
+#: src/unsafe/asm.md:47
msgid "\"mov {}, 5\""
msgstr "\"mov {}, 5\""
-#: src/unsafe/asm.md:52
+#: src/unsafe/asm.md:53
msgid ""
"This will write the value `5` into the `u64` variable `x`. You can see that "
"the string literal we use to specify instructions is actually a template "
-"string. It is governed by the same rules as Rust [format strings](https://doc."
-"rust-lang.org/std/fmt/#syntax). The arguments that are inserted into the "
-"template however look a bit different than you may be familiar with. First we "
-"need to specify if the variable is an input or an output of the inline "
-"assembly. In this case it is an output. We declared this by writing `out`. We "
-"also need to specify in what kind of register the assembly expects the "
+"string. It is governed by the same rules as Rust [format strings](https://"
+"doc.rust-lang.org/std/fmt/#syntax). The arguments that are inserted into the "
+"template however look a bit different than you may be familiar with. First "
+"we need to specify if the variable is an input or an output of the inline "
+"assembly. In this case it is an output. We declared this by writing `out`. "
+"We also need to specify in what kind of register the assembly expects the "
"variable. In this case we put it in an arbitrary general purpose register by "
"specifying `reg`. The compiler will choose an appropriate register to insert "
"into the template and will read the variable from there after the inline "
"assembly finishes executing."
msgstr ""
-"这将把值 `5` 写入 `u64` 类型的变量 `x`。你可以看到,我们用来指定指令的字符串字面量实际上是一个模板字符串。它遵循与 Rust [格式化字符串](https://doc.rust-lang.org/std/fmt/#syntax)相同的规则。然而,插入到模板中的参数看起来可能与你熟悉的有些不同。首先,我们需要指定变量是内联汇编的输入还是输出。在这个例子中,它是一个输出。我们通过写 `out` 来声明这一点。我们还需要指定汇编期望变量在什么类型的寄存器中。这里我们通过指定 `reg` 将其放在任意通用寄存器中。编译器将选择一个合适的寄存器插入到模板中,并在内联汇编执行完成后从该寄存器读取变量的值。"
+"这将把值 `5` 写入 `u64` 类型的变量 `x`。你可以看到,我们用来指定指令的字符串"
+"字面量实际上是一个模板字符串。它遵循与 Rust [格式化字符串](https://doc.rust-"
+"lang.org/std/fmt/#syntax)相同的规则。然而,插入到模板中的参数看起来可能与你熟"
+"悉的有些不同。首先,我们需要指定变量是内联汇编的输入还是输出。在这个例子中,"
+"它是一个输出。我们通过写 `out` 来声明这一点。我们还需要指定汇编期望变量在什么"
+"类型的寄存器中。这里我们通过指定 `reg` 将其放在任意通用寄存器中。编译器将选择"
+"一个合适的寄存器插入到模板中,并在内联汇编执行完成后从该寄存器读取变量的值。"
-#: src/unsafe/asm.md:65
+#: src/unsafe/asm.md:66
msgid "Let us see another example that also uses an input:"
msgstr "让我们再看一个使用输入的例子:"
-#: src/unsafe/asm.md:75
+#: src/unsafe/asm.md:76
msgid "\"mov {0}, {1}\""
msgstr "\"mov {0}, {1}\""
-#: src/unsafe/asm.md:76 src/unsafe/asm.md:111 src/unsafe/asm.md:129
+#: src/unsafe/asm.md:77 src/unsafe/asm.md:112 src/unsafe/asm.md:130
msgid "\"add {0}, 5\""
msgstr "\"add {0}, 5\""
-#: src/unsafe/asm.md:85
+#: src/unsafe/asm.md:86
msgid ""
"This will add `5` to the input in variable `i` and write the result to "
-"variable `o`. The particular way this assembly does this is first copying the "
-"value from `i` to the output, and then adding `5` to it."
+"variable `o`. The particular way this assembly does this is first copying "
+"the value from `i` to the output, and then adding `5` to it."
msgstr ""
-"这段代码会将 `5` 加到变量 `i` 的值上,然后将结果写入变量 `o`。具体的汇编实现是先将 `i` 的值复制到输出寄存器,然后再加上 `5`。"
+"这段代码会将 `5` 加到变量 `i` 的值上,然后将结果写入变量 `o`。具体的汇编实现"
+"是先将 `i` 的值复制到输出寄存器,然后再加上 `5`。"
-#: src/unsafe/asm.md:89
+#: src/unsafe/asm.md:90
msgid "The example shows a few things:"
msgstr "这个例子展示了几个要点:"
-#: src/unsafe/asm.md:91
+#: src/unsafe/asm.md:92
msgid ""
-"First, we can see that `asm!` allows multiple template string arguments; each "
-"one is treated as a separate line of assembly code, as if they were all "
+"First, we can see that `asm!` allows multiple template string arguments; "
+"each one is treated as a separate line of assembly code, as if they were all "
"joined together with newlines between them. This makes it easy to format "
"assembly code."
msgstr ""
-"`asm!` 宏支持多个模板字符串参数,每个参数都被视为独立的汇编代码行,就像它们之间用换行符连接一样。这使得格式化汇编代码变得简单。"
+"`asm!` 宏支持多个模板字符串参数,每个参数都被视为独立的汇编代码行,就像它们之"
+"间用换行符连接一样。这使得格式化汇编代码变得简单。"
-#: src/unsafe/asm.md:96
+#: src/unsafe/asm.md:97
msgid ""
"Second, we can see that inputs are declared by writing `in` instead of `out`."
-msgstr ""
-"其次,我们可以看到输入参数使用 `in` 声明,而不是 `out`。"
+msgstr "其次,我们可以看到输入参数使用 `in` 声明,而不是 `out`。"
-#: src/unsafe/asm.md:98
+#: src/unsafe/asm.md:99
msgid ""
"Third, we can see that we can specify an argument number, or name as in any "
"format string. For inline assembly templates this is particularly useful as "
"arguments are often used more than once. For more complex inline assembly "
-"using this facility is generally recommended, as it improves readability, and "
-"allows reordering instructions without changing the argument order."
+"using this facility is generally recommended, as it improves readability, "
+"and allows reordering instructions without changing the argument order."
msgstr ""
-"第三,我们可以像在任何格式字符串中一样指定参数编号或名称。这在内联汇编模板中特别有用,因为参数通常会被多次使用。对于更复杂的内联汇编,建议使用这种方式,因为它提高了可读性,并且允许在不改变参数顺序的情况下重新排列指令。"
+"第三,我们可以像在任何格式字符串中一样指定参数编号或名称。这在内联汇编模板中"
+"特别有用,因为参数通常会被多次使用。对于更复杂的内联汇编,建议使用这种方式,"
+"因为它提高了可读性,并且允许在不改变参数顺序的情况下重新排列指令。"
-#: src/unsafe/asm.md:103
+#: src/unsafe/asm.md:104
msgid "We can further refine the above example to avoid the `mov` instruction:"
msgstr "我们可以进一步优化上面的例子,避免使用 `mov` 指令:"
-#: src/unsafe/asm.md:117
+#: src/unsafe/asm.md:118
msgid ""
-"We can see that `inout` is used to specify an argument that is both input and "
-"output. This is different from specifying an input and output separately in "
-"that it is guaranteed to assign both to the same register."
+"We can see that `inout` is used to specify an argument that is both input "
+"and output. This is different from specifying an input and output separately "
+"in that it is guaranteed to assign both to the same register."
msgstr ""
-"我们可以看到 `inout` 用于指定既作为输入又作为输出的参数。这与分别指定输入和输出不同,它保证将两者分配到同一个寄存器。"
+"我们可以看到 `inout` 用于指定既作为输入又作为输出的参数。这与分别指定输入和输"
+"出不同,它保证将两者分配到同一个寄存器。"
-#: src/unsafe/asm.md:120
+#: src/unsafe/asm.md:121
msgid ""
"It is also possible to specify different variables for the input and output "
"parts of an `inout` operand:"
-msgstr ""
-"也可以为 `inout` 操作数的输入和输出部分指定不同的变量:"
+msgstr "也可以为 `inout` 操作数的输入和输出部分指定不同的变量:"
-#: src/unsafe/asm.md:135
+#: src/unsafe/asm.md:136
msgid "Late output operands"
msgstr "延迟输出操作数"
-#: src/unsafe/asm.md:137
+#: src/unsafe/asm.md:138
msgid ""
"The Rust compiler is conservative with its allocation of operands. It is "
-"assumed that an `out` can be written at any time, and can therefore not share "
-"its location with any other argument. However, to guarantee optimal "
+"assumed that an `out` can be written at any time, and can therefore not "
+"share its location with any other argument. However, to guarantee optimal "
"performance it is important to use as few registers as possible, so they "
"won't have to be saved and reloaded around the inline assembly block. To "
"achieve this Rust provides a `lateout` specifier. This can be used on any "
"output that is written only after all inputs have been consumed. There is "
"also an `inlateout` variant of this specifier."
msgstr ""
-"Rust 编译器在分配操作数时采取保守策略。它假设 `out` 可以在任何时候被写入,因此不能与其他参数共享位置。然而,为了保证最佳性能,使用尽可能少的寄存器很重要,这样就不必在内联汇编块前后保存和重新加载寄存器。为此,Rust 提供了 `lateout` 说明符。这可以用于任何在所有输入被消耗后才写入的输出。此外还有一个 `inlateout` 变体。"
+"Rust 编译器在分配操作数时采取保守策略。它假设 `out` 可以在任何时候被写入,因"
+"此不能与其他参数共享位置。然而,为了保证最佳性能,使用尽可能少的寄存器很重"
+"要,这样就不必在内联汇编块前后保存和重新加载寄存器。为此,Rust 提供了 "
+"`lateout` 说明符。这可以用于任何在所有输入被消耗后才写入的输出。此外还有一个 "
+"`inlateout` 变体。"
-#: src/unsafe/asm.md:145
+#: src/unsafe/asm.md:146
msgid ""
"Here is an example where `inlateout` _cannot_ be used in `release` mode or "
"other optimized cases:"
msgstr ""
"以下是一个在 `release` 模式或其他优化情况下 _不能_ 使用 `inlateout` 的例子:"
-#: src/unsafe/asm.md:156 src/unsafe/asm.md:180 src/unsafe/asm.md:463
+#: src/unsafe/asm.md:157 src/unsafe/asm.md:189 src/unsafe/asm.md:472
msgid "\"add {0}, {1}\""
msgstr "\"add {0}, {1}\""
-#: src/unsafe/asm.md:157
+#: src/unsafe/asm.md:158
msgid "\"add {0}, {2}\""
msgstr "\"add {0}, {2}\""
-#: src/unsafe/asm.md:167
+#: src/unsafe/asm.md:168
msgid ""
"In unoptimized cases (e.g. `Debug` mode), replacing `inout(reg) a` with "
"`inlateout(reg) a` in the above example can continue to give the expected "
@@ -15983,38 +16575,45 @@
"`inlateout(reg) a` can instead lead to the final value `a = 16`, causing the "
"assertion to fail."
msgstr ""
-"在未优化的情况下(如 `Debug` 模式),将上述例子中的 `inout(reg) a` 替换为 `inlateout(reg) a` 仍能得到预期结果。但在 `release` 模式或其他优化情况下,使用 `inlateout(reg) a` 可能导致最终值 `a = 16`,使断言失败。"
+"在未优化的情况下(如 `Debug` 模式),将上述例子中的 `inout(reg) a` 替换为 "
+"`inlateout(reg) a` 仍能得到预期结果。但在 `release` 模式或其他优化情况下,使"
+"用 `inlateout(reg) a` 可能导致最终值 `a = 16`,使断言失败。"
-#: src/unsafe/asm.md:169
+#: src/unsafe/asm.md:173
msgid ""
-"This is because in optimized cases, the compiler is free to allocate the same "
-"register for inputs `b` and `c` since it knows that they have the same value. "
-"Furthermore, when `inlateout` is used, `a` and `c` could be allocated to the "
-"same register, in which case the first `add` instruction would overwrite the "
-"initial load from variable `c`. This is in contrast to how using `inout(reg) "
-"a` ensures a separate register is allocated for `a`."
+"This is because in optimized cases, the compiler is free to allocate the "
+"same register for inputs `b` and `c` since it knows that they have the same "
+"value. Furthermore, when `inlateout` is used, `a` and `c` could be allocated "
+"to the same register, in which case the first `add` instruction would "
+"overwrite the initial load from variable `c`. This is in contrast to how "
+"using `inout(reg) a` ensures a separate register is allocated for `a`."
msgstr ""
-"这是因为在优化情况下,编译器可以为输入 `b` 和 `c` 分配相同的寄存器,因为它知道它们具有相同的值。此外,当使用 `inlateout` 时,`a` 和 `c` 可能被分配到同一个寄存器,这种情况下,第一条 `add` 指令会覆盖从变量 `c` 初始加载的值。相比之下,使用 `inout(reg) a` 可以确保为 `a` 分配一个单独的寄存器。"
+"这是因为在优化情况下,编译器可以为输入 `b` 和 `c` 分配相同的寄存器,因为它知"
+"道它们具有相同的值。此外,当使用 `inlateout` 时,`a` 和 `c` 可能被分配到同一"
+"个寄存器,这种情况下,第一条 `add` 指令会覆盖从变量 `c` 初始加载的值。相比之"
+"下,使用 `inout(reg) a` 可以确保为 `a` 分配一个单独的寄存器。"
-#: src/unsafe/asm.md:171
+#: src/unsafe/asm.md:179
msgid ""
"However, the following example can use `inlateout` since the output is only "
"modified after all input registers have been read:"
msgstr ""
-"然而,以下示例可以使用 `inlateout`,因为输出仅在读取所有输入寄存器后才被修改:"
+"然而,以下示例可以使用 `inlateout`,因为输出仅在读取所有输入寄存器后才被修"
+"改:"
-#: src/unsafe/asm.md:186
+#: src/unsafe/asm.md:195
msgid ""
"As you can see, this assembly fragment will still work correctly if `a` and "
"`b` are assigned to the same register."
msgstr ""
-"如你所见,即使 `a` 和 `b` 被分配到同一个寄存器,这段汇编代码片段仍能正确运行。"
+"如你所见,即使 `a` 和 `b` 被分配到同一个寄存器,这段汇编代码片段仍能正确运"
+"行。"
-#: src/unsafe/asm.md:188
+#: src/unsafe/asm.md:197
msgid "Explicit register operands"
msgstr "显式寄存器操作数"
-#: src/unsafe/asm.md:190
+#: src/unsafe/asm.md:199
msgid ""
"Some instructions require that the operands be in a specific register. "
"Therefore, Rust inline assembly provides some more specific constraint "
@@ -16023,39 +16622,46 @@
"registers `eax`, `ebx`, `ecx`, `edx`, `ebp`, `esi`, and `edi` among others "
"can be addressed by their name."
msgstr ""
-"某些指令要求操作数必须位于特定寄存器中。因此,Rust 内联汇编提供了一些更具体的约束说明符。虽然 `reg` 通常适用于任何架构,但显式寄存器高度依赖于特定架构。例如,对于 x86 架构,通用寄存器如 `eax`、`ebx`、`ecx`、`edx`、`ebp`、`esi` 和 `edi` 等可以直接通过名称进行寻址。"
+"某些指令要求操作数必须位于特定寄存器中。因此,Rust 内联汇编提供了一些更具体的"
+"约束说明符。虽然 `reg` 通常适用于任何架构,但显式寄存器高度依赖于特定架构。例"
+"如,对于 x86 架构,通用寄存器如 `eax`、`ebx`、`ecx`、`edx`、`ebp`、`esi` 和 "
+"`edi` 等可以直接通过名称进行寻址。"
-#: src/unsafe/asm.md:200
+#: src/unsafe/asm.md:209
msgid "\"out 0x64, eax\""
msgstr "\"out 0x64, eax\""
-#: src/unsafe/asm.md:200 src/unsafe/asm.md:276
+#: src/unsafe/asm.md:209 src/unsafe/asm.md:285
msgid "\"eax\""
msgstr "\"eax\""
-#: src/unsafe/asm.md:205
+#: src/unsafe/asm.md:214
msgid ""
"In this example we call the `out` instruction to output the content of the "
-"`cmd` variable to port `0x64`. Since the `out` instruction only accepts `eax` "
-"(and its sub registers) as operand we had to use the `eax` constraint "
+"`cmd` variable to port `0x64`. Since the `out` instruction only accepts "
+"`eax` (and its sub registers) as operand we had to use the `eax` constraint "
"specifier."
msgstr ""
-"在这个例子中,我们调用 `out` 指令将 `cmd` 变量的内容输出到端口 `0x64`。由于 `out` 指令只接受 `eax`(及其子寄存器)作为操作数,我们必须使用 `eax` 约束说明符。"
+"在这个例子中,我们调用 `out` 指令将 `cmd` 变量的内容输出到端口 `0x64`。由于 "
+"`out` 指令只接受 `eax`(及其子寄存器)作为操作数,我们必须使用 `eax` 约束说明"
+"符。"
-#: src/unsafe/asm.md:207
+#: src/unsafe/asm.md:216
msgid ""
"**Note**: unlike other operand types, explicit register operands cannot be "
-"used in the template string: you can't use `{}` and should write the register "
-"name directly instead. Also, they must appear at the end of the operand list "
-"after all other operand types."
+"used in the template string: you can't use `{}` and should write the "
+"register name directly instead. Also, they must appear at the end of the "
+"operand list after all other operand types."
msgstr ""
-"**注意**:与其他操作数类型不同,显式寄存器操作数不能在模板字符串中使用。你不能使用 `{}`,而应直接写入寄存器名称。此外,它们必须出现在操作数列表的末尾,位于所有其他操作数类型之后。"
+"**注意**:与其他操作数类型不同,显式寄存器操作数不能在模板字符串中使用。你不"
+"能使用 `{}`,而应直接写入寄存器名称。此外,它们必须出现在操作数列表的末尾,位"
+"于所有其他操作数类型之后。"
-#: src/unsafe/asm.md:209
+#: src/unsafe/asm.md:218
msgid "Consider this example which uses the x86 `mul` instruction:"
msgstr "考虑以下使用 x86 `mul` 指令的例子:"
-#: src/unsafe/asm.md:221
+#: src/unsafe/asm.md:230
msgid ""
"// The x86 mul instruction takes rax as an implicit input and writes\n"
" // the 128-bit result of the multiplication to rax:rdx.\n"
@@ -16065,45 +16671,51 @@
" // 并将乘法的 128 位结果写入 rax:rdx。\n"
" \"mul {}\""
-#: src/unsafe/asm.md:225 src/unsafe/asm.md:347
+#: src/unsafe/asm.md:234 src/unsafe/asm.md:356
msgid "\"rax\""
msgstr "\"rax\""
-#: src/unsafe/asm.md:226
+#: src/unsafe/asm.md:235
msgid "\"rdx\""
msgstr "\"rdx\""
-#: src/unsafe/asm.md:235
+#: src/unsafe/asm.md:244
msgid ""
"This uses the `mul` instruction to multiply two 64-bit inputs with a 128-bit "
"result. The only explicit operand is a register, that we fill from the "
-"variable `a`. The second operand is implicit, and must be the `rax` register, "
-"which we fill from the variable `b`. The lower 64 bits of the result are "
-"stored in `rax` from which we fill the variable `lo`. The higher 64 bits are "
-"stored in `rdx` from which we fill the variable `hi`."
+"variable `a`. The second operand is implicit, and must be the `rax` "
+"register, which we fill from the variable `b`. The lower 64 bits of the "
+"result are stored in `rax` from which we fill the variable `lo`. The higher "
+"64 bits are stored in `rdx` from which we fill the variable `hi`."
msgstr ""
-"这里使用 `mul` 指令将两个 64 位输入相乘,得到一个 128 位的结果。唯一的显式操作数是一个寄存器,我们用变量 `a` 填充它。第二个操作数是隐式的,必须是 `rax` 寄存器,我们用变量 `b` 填充它。结果的低 64 位存储在 `rax` 中,用于填充变量 `lo`。高 64 位存储在 `rdx` 中,用于填充变量 `hi`。"
+"这里使用 `mul` 指令将两个 64 位输入相乘,得到一个 128 位的结果。唯一的显式操"
+"作数是一个寄存器,我们用变量 `a` 填充它。第二个操作数是隐式的,必须是 `rax` "
+"寄存器,我们用变量 `b` 填充它。结果的低 64 位存储在 `rax` 中,用于填充变量 "
+"`lo`。高 64 位存储在 `rdx` 中,用于填充变量 `hi`。"
-#: src/unsafe/asm.md:241
+#: src/unsafe/asm.md:250
msgid "Clobbered registers"
msgstr "被破坏的寄存器"
-#: src/unsafe/asm.md:243
+#: src/unsafe/asm.md:252
msgid ""
"In many cases inline assembly will modify state that is not needed as an "
"output. Usually this is either because we have to use a scratch register in "
"the assembly or because instructions modify state that we don't need to "
"further examine. This state is generally referred to as being \"clobbered\". "
-"We need to tell the compiler about this since it may need to save and restore "
-"this state around the inline assembly block."
+"We need to tell the compiler about this since it may need to save and "
+"restore this state around the inline assembly block."
msgstr ""
-"在许多情况下,内联汇编会修改不需要作为输出的状态。这通常是因为我们必须在汇编中使用临时寄存器,或者因为指令修改了我们不需要进一步检查的状态。这种状态通常被称为"被破坏"。我们需要告知编译器这一点,因为它可能需要在内联汇编块前后保存和恢复这种状态。"
+"在许多情况下,内联汇编会修改不需要作为输出的状态。这通常是因为我们必须在汇编"
+"中使用临时寄存器,或者因为指令修改了我们不需要进一步检查的状态。这种状态通常"
+"被称为\"被破坏\"。我们需要告知编译器这一点,因为它可能需要在内联汇编块前后保"
+"存和恢复这种状态。"
-#: src/unsafe/asm.md:253
+#: src/unsafe/asm.md:262
msgid "// three entries of four bytes each\n"
msgstr "// 三个条目,每个四字节\n"
-#: src/unsafe/asm.md:255
+#: src/unsafe/asm.md:264
msgid ""
"// String is stored as ascii in ebx, edx, ecx in order\n"
" // Because ebx is reserved, the asm needs to preserve the value of it.\n"
@@ -16115,104 +16727,113 @@
"// 字符串按顺序以 ASCII 格式存储在 ebx、edx、ecx 中\n"
" // 由于 ebx 是保留寄存器,汇编需要保留其值\n"
" // 因此我们在主要汇编代码前后执行 push 和 pop 操作\n"
-" // 64 位处理器的 64 位模式不允许对 32 位寄存器(如 ebx)进行 push/pop 操作\n"
+" // 64 位处理器的 64 位模式不允许对 32 位寄存器(如 ebx)进行 push/pop 操"
+"作\n"
" // 所以我们必须使用扩展的 rbx 寄存器\n"
-#: src/unsafe/asm.md:263
+#: src/unsafe/asm.md:272
msgid "\"push rbx\""
msgstr "\"push rbx\""
-#: src/unsafe/asm.md:264
+#: src/unsafe/asm.md:273
msgid "\"cpuid\""
msgstr "\"cpuid\""
-#: src/unsafe/asm.md:265
+#: src/unsafe/asm.md:274
msgid "\"mov [rdi], ebx\""
msgstr "\"mov [rdi], ebx\""
-#: src/unsafe/asm.md:266
+#: src/unsafe/asm.md:275
msgid "\"mov [rdi + 4], edx\""
msgstr "\"mov [rdi + 4], edx\""
-#: src/unsafe/asm.md:267
+#: src/unsafe/asm.md:276
msgid "\"mov [rdi + 8], ecx\""
msgstr "\"mov [rdi + 8], ecx\""
-#: src/unsafe/asm.md:268
+#: src/unsafe/asm.md:277
msgid "\"pop rbx\""
msgstr "\"pop rbx\""
-#: src/unsafe/asm.md:269
+#: src/unsafe/asm.md:278
msgid ""
"// We use a pointer to an array for storing the values to simplify\n"
" // the Rust code at the cost of a couple more asm instructions\n"
" // This is more explicit with how the asm works however, as "
"opposed\n"
" // to explicit register outputs such as `out(\"ecx\") val`\n"
-" // The *pointer itself* is only an input even though it's written "
-"behind\n"
+" // The *pointer itself* is only an input even though it's "
+"written behind\n"
msgstr ""
"// 我们使用指向数组的指针来存储值,以简化 Rust 代码\n"
" // 虽然这会增加几条汇编指令,但更清晰地展示了汇编的工作方式\n"
" // 相比于使用显式寄存器输出(如 `out(\"ecx\") val`)\n"
" // *指针本身*只是一个输入,尽管它在背后被写入\n"
-#: src/unsafe/asm.md:274 src/unsafe/asm.md:345
+#: src/unsafe/asm.md:283 src/unsafe/asm.md:354
msgid "\"rdi\""
msgstr "\"rdi\""
-#: src/unsafe/asm.md:275
+#: src/unsafe/asm.md:284
msgid "// select cpuid 0, also specify eax as clobbered\n"
msgstr "// 选择 cpuid 0,同时指定 eax 为被修改寄存器\n"
-#: src/unsafe/asm.md:277
+#: src/unsafe/asm.md:286
msgid "// cpuid clobbers these registers too\n"
msgstr "// cpuid 也会修改这些寄存器\n"
-#: src/unsafe/asm.md:278
+#: src/unsafe/asm.md:287
msgid "\"ecx\""
msgstr "\"ecx\""
-#: src/unsafe/asm.md:279
+#: src/unsafe/asm.md:288
msgid "\"edx\""
msgstr "\"edx\""
-#: src/unsafe/asm.md:284
+#: src/unsafe/asm.md:293
msgid "\"CPU Manufacturer ID: {}\""
msgstr "\"CPU 制造商 ID:{}\""
-#: src/unsafe/asm.md:291
+#: src/unsafe/asm.md:300
msgid ""
"In the example above we use the `cpuid` instruction to read the CPU "
"manufacturer ID. This instruction writes to `eax` with the maximum supported "
"`cpuid` argument and `ebx`, `edx`, and `ecx` with the CPU manufacturer ID as "
"ASCII bytes in that order."
msgstr ""
-"在上面的示例中,我们使用 `cpuid` 指令读取 CPU 制造商 ID。该指令将最大支持的 `cpuid` 参数写入 `eax`,并按顺序将 CPU 制造商 ID 的 ASCII 字节写入 `ebx`、`edx` 和 `ecx`。"
+"在上面的示例中,我们使用 `cpuid` 指令读取 CPU 制造商 ID。该指令将最大支持的 "
+"`cpuid` 参数写入 `eax`,并按顺序将 CPU 制造商 ID 的 ASCII 字节写入 `ebx`、"
+"`edx` 和 `ecx`。"
-#: src/unsafe/asm.md:294
+#: src/unsafe/asm.md:303
msgid ""
"Even though `eax` is never read we still need to tell the compiler that the "
-"register has been modified so that the compiler can save any values that were "
-"in these registers before the asm. This is done by declaring it as an output "
-"but with `_` instead of a variable name, which indicates that the output "
-"value is to be discarded."
+"register has been modified so that the compiler can save any values that "
+"were in these registers before the asm. This is done by declaring it as an "
+"output but with `_` instead of a variable name, which indicates that the "
+"output value is to be discarded."
msgstr ""
-"尽管 `eax` 从未被读取,我们仍需要告知编译器该寄存器已被修改,这样编译器就可以保存汇编前这些寄存器中的任何值。我们通过将其声明为输出来实现这一点,但使用 `_` 而非变量名,表示输出值将被丢弃。"
+"尽管 `eax` 从未被读取,我们仍需要告知编译器该寄存器已被修改,这样编译器就可以"
+"保存汇编前这些寄存器中的任何值。我们通过将其声明为输出来实现这一点,但使用 "
+"`_` 而非变量名,表示输出值将被丢弃。"
-#: src/unsafe/asm.md:296
+#: src/unsafe/asm.md:305
msgid ""
"This code also works around the limitation that `ebx` is a reserved register "
"by LLVM. That means that LLVM assumes that it has full control over the "
-"register and it must be restored to its original state before exiting the asm "
-"block, so it cannot be used as an input or output **except** if the compiler "
-"uses it to fulfill a general register class (e.g. `in(reg)`). This makes "
-"`reg` operands dangerous when using reserved registers as we could "
+"register and it must be restored to its original state before exiting the "
+"asm block, so it cannot be used as an input or output **except** if the "
+"compiler uses it to fulfill a general register class (e.g. `in(reg)`). This "
+"makes `reg` operands dangerous when using reserved registers as we could "
"unknowingly corrupt our input or output because they share the same register."
msgstr ""
-"这段代码还解决了 LLVM 将 `ebx` 视为保留寄存器的限制。这意味着 LLVM 假定它对该寄存器拥有完全控制权,并且必须在退出汇编块之前将其恢复到原始状态。因此,`ebx` 不能用作输入或输出,**除非**编译器将其用于满足通用寄存器类(如 `in(reg)`)。这使得在使用保留寄存器时,`reg` 操作数变得危险,因为我们可能会在不知情的情况下破坏输入或输出,原因是它们共享同一个寄存器。"
+"这段代码还解决了 LLVM 将 `ebx` 视为保留寄存器的限制。这意味着 LLVM 假定它对该"
+"寄存器拥有完全控制权,并且必须在退出汇编块之前将其恢复到原始状态。因此,"
+"`ebx` 不能用作输入或输出,**除非**编译器将其用于满足通用寄存器类(如 "
+"`in(reg)`)。这使得在使用保留寄存器时,`reg` 操作数变得危险,因为我们可能会在"
+"不知情的情况下破坏输入或输出,原因是它们共享同一个寄存器。"
-#: src/unsafe/asm.md:298
+#: src/unsafe/asm.md:307
msgid ""
"To work around this we use `rdi` to store the pointer to the output array, "
"save `ebx` via `push`, read from `ebx` inside the asm block into the array "
@@ -16221,77 +16842,85 @@
"register is saved. On 32 bit targets the code would instead use `ebx` in the "
"`push`/`pop`."
msgstr ""
-"为了解决这个问题,我们采用以下策略:使用 `rdi` 存储输出数组的指针;通过 `push` 保存 `ebx`;在汇编块内从 `ebx` 读取数据到数组中;然后通过 `pop` 将 `ebx` 恢复到原始状态。`push` 和 `pop` 操作使用完整的 64 位 `rbx` 寄存器版本,以确保整个寄存器被保存。在 32 位目标上,代码会在 `push`/`pop` 操作中使用 `ebx`。"
+"为了解决这个问题,我们采用以下策略:使用 `rdi` 存储输出数组的指针;通过 "
+"`push` 保存 `ebx`;在汇编块内从 `ebx` 读取数据到数组中;然后通过 `pop` 将 "
+"`ebx` 恢复到原始状态。`push` 和 `pop` 操作使用完整的 64 位 `rbx` 寄存器版本,"
+"以确保整个寄存器被保存。在 32 位目标上,代码会在 `push`/`pop` 操作中使用 "
+"`ebx`。"
-#: src/unsafe/asm.md:300
+#: src/unsafe/asm.md:309
msgid ""
"This can also be used with a general register class to obtain a scratch "
"register for use inside the asm code:"
msgstr ""
"这种技术还可以与通用寄存器类一起使用,以获得一个临时寄存器在汇编代码内使用:"
-#: src/unsafe/asm.md:305
+#: src/unsafe/asm.md:314
msgid "// Multiply x by 6 using shifts and adds\n"
msgstr "// 使用移位和加法将 x 乘以 6\n"
-#: src/unsafe/asm.md:310
+#: src/unsafe/asm.md:319
msgid "\"mov {tmp}, {x}\""
msgstr "\"mov {tmp}, {x}\""
-#: src/unsafe/asm.md:311
+#: src/unsafe/asm.md:320
msgid "\"shl {tmp}, 1\""
msgstr "\"shl {tmp}, 1\""
-#: src/unsafe/asm.md:312
+#: src/unsafe/asm.md:321
msgid "\"shl {x}, 2\""
msgstr "\"shl {x}, 2\""
-#: src/unsafe/asm.md:313
+#: src/unsafe/asm.md:322
msgid "\"add {x}, {tmp}\""
msgstr "\"add {x}, {tmp}\""
-#: src/unsafe/asm.md:322
+#: src/unsafe/asm.md:331
msgid "Symbol operands and ABI clobbers"
msgstr "符号操作数和 ABI 破坏"
-#: src/unsafe/asm.md:324
+#: src/unsafe/asm.md:333
msgid ""
"By default, `asm!` assumes that any register not specified as an output will "
-"have its contents preserved by the assembly code. The [`clobber_abi`](https://"
-"doc.rust-lang.org/stable/reference/inline-assembly.html#abi-clobbers) "
-"argument to `asm!` tells the compiler to automatically insert the necessary "
-"clobber operands according to the given calling convention ABI: any register "
-"which is not fully preserved in that ABI will be treated as clobbered. "
-"Multiple `clobber_abi` arguments may be provided and all clobbers from all "
-"specified ABIs will be inserted."
+"have its contents preserved by the assembly code. The [`clobber_abi`]"
+"(https://doc.rust-lang.org/stable/reference/inline-assembly.html#abi-"
+"clobbers) argument to `asm!` tells the compiler to automatically insert the "
+"necessary clobber operands according to the given calling convention ABI: "
+"any register which is not fully preserved in that ABI will be treated as "
+"clobbered. Multiple `clobber_abi` arguments may be provided and all "
+"clobbers from all specified ABIs will be inserted."
msgstr ""
-"默认情况下,`asm!` 假定汇编代码会保留所有未指定为输出的寄存器的内容。`asm!` 的 [`clobber_abi`](https://doc.rust-lang.org/stable/reference/inline-assembly.html#abi-clobbers) 参数告诉编译器根据给定的调用约定 ABI 自动插入必要的破坏操作数:任何在该 ABI 中未完全保留的寄存器都将被视为被破坏。可以提供多个 `clobber_abi` 参数,所有指定 ABI 的破坏都将被插入。"
+"默认情况下,`asm!` 假定汇编代码会保留所有未指定为输出的寄存器的内容。`asm!` "
+"的 [`clobber_abi`](https://doc.rust-lang.org/stable/reference/inline-"
+"assembly.html#abi-clobbers) 参数告诉编译器根据给定的调用约定 ABI 自动插入必要"
+"的破坏操作数:任何在该 ABI 中未完全保留的寄存器都将被视为被破坏。可以提供多"
+"个 `clobber_abi` 参数,所有指定 ABI 的破坏都将被插入。"
-#: src/unsafe/asm.md:332 src/unsafe/asm.md:350
+#: src/unsafe/asm.md:341 src/unsafe/asm.md:359
msgid "\"C\""
msgstr "\"C\""
-#: src/unsafe/asm.md:333
+#: src/unsafe/asm.md:342
msgid "\"arg = {}\""
msgstr "\"arg = {}\""
-#: src/unsafe/asm.md:341
+#: src/unsafe/asm.md:350
msgid "\"call {}\""
msgstr "\"call {}\""
-#: src/unsafe/asm.md:342
+#: src/unsafe/asm.md:351
msgid "// Function pointer to call\n"
msgstr "// 要调用的函数指针\n"
-#: src/unsafe/asm.md:344
+#: src/unsafe/asm.md:353
msgid "// 1st argument in rdi\n"
msgstr "// 第一个参数在 rdi 中\n"
-#: src/unsafe/asm.md:346
+#: src/unsafe/asm.md:355
msgid "// Return value in rax\n"
msgstr "// 返回值在 rax 中\n"
-#: src/unsafe/asm.md:348
+#: src/unsafe/asm.md:357
msgid ""
"// Mark all registers which are not preserved by the \"C\" calling\n"
" // convention as clobbered.\n"
@@ -16299,11 +16928,11 @@
"// 将所有不被 \"C\" 调用约定保留的寄存器\n"
" // 标记为被破坏\n"
-#: src/unsafe/asm.md:358
+#: src/unsafe/asm.md:367
msgid "Register template modifiers"
msgstr "寄存器模板修饰符"
-#: src/unsafe/asm.md:360
+#: src/unsafe/asm.md:369
msgid ""
"In some cases, fine control is needed over the way a register name is "
"formatted when inserted into the template string. This is needed when an "
@@ -16311,57 +16940,65 @@
"each typically being a \"view\" over a subset of the register (e.g. the low "
"32 bits of a 64-bit register)."
msgstr ""
-"在某些情况下,需要对寄存器名称插入模板字符串时的格式进行精细控制。当一个架构的汇编语言对同一个寄存器有多个名称时,这种控制尤为必要。每个名称通常代表寄存器的一个子集"视图"(例如,64 位寄存器的低 32 位)。"
+"在某些情况下,需要对寄存器名称插入模板字符串时的格式进行精细控制。当一个架构"
+"的汇编语言对同一个寄存器有多个名称时,这种控制尤为必要。每个名称通常代表寄存"
+"器的一个子集\"视图\"(例如,64 位寄存器的低 32 位)。"
-#: src/unsafe/asm.md:362
+#: src/unsafe/asm.md:371
msgid ""
"By default the compiler will always choose the name that refers to the full "
"register size (e.g. `rax` on x86-64, `eax` on x86, etc)."
msgstr ""
-"默认情况下,编译器总是会选择引用完整寄存器大小的名称(例如,在 x86-64 上是 `rax`,在 x86 上是 `eax` 等)。"
+"默认情况下,编译器总是会选择引用完整寄存器大小的名称(例如,在 x86-64 上是 "
+"`rax`,在 x86 上是 `eax` 等)。"
-#: src/unsafe/asm.md:364
+#: src/unsafe/asm.md:373
msgid ""
"This default can be overridden by using modifiers on the template string "
"operands, just like you would with format strings:"
msgstr ""
-"可以通过在模板字符串操作数上使用修饰符来覆盖这个默认设置,类似于格式字符串的用法:"
+"可以通过在模板字符串操作数上使用修饰符来覆盖这个默认设置,类似于格式字符串的"
+"用法:"
-#: src/unsafe/asm.md:373
+#: src/unsafe/asm.md:382
msgid "\"mov {0:h}, {0:l}\""
msgstr "\"mov {0:h}, {0:l}\""
-#: src/unsafe/asm.md:380
+#: src/unsafe/asm.md:389
msgid ""
"In this example, we use the `reg_abcd` register class to restrict the "
"register allocator to the 4 legacy x86 registers (`ax`, `bx`, `cx`, `dx`) of "
"which the first two bytes can be addressed independently."
msgstr ""
-"在这个例子中,我们使用 `reg_abcd` 寄存器类来限制寄存器分配器只使用 4 个传统的 x86 寄存器(`ax`、`bx`、`cx`、`dx`)。这些寄存器的前两个字节可以独立寻址。"
+"在这个例子中,我们使用 `reg_abcd` 寄存器类来限制寄存器分配器只使用 4 个传统"
+"的 x86 寄存器(`ax`、`bx`、`cx`、`dx`)。这些寄存器的前两个字节可以独立寻址。"
-#: src/unsafe/asm.md:382
+#: src/unsafe/asm.md:391
msgid ""
"Let us assume that the register allocator has chosen to allocate `x` in the "
-"`ax` register. The `h` modifier will emit the register name for the high byte "
-"of that register and the `l` modifier will emit the register name for the low "
-"byte. The asm code will therefore be expanded as `mov ah, al` which copies "
-"the low byte of the value into the high byte."
+"`ax` register. The `h` modifier will emit the register name for the high "
+"byte of that register and the `l` modifier will emit the register name for "
+"the low byte. The asm code will therefore be expanded as `mov ah, al` which "
+"copies the low byte of the value into the high byte."
msgstr ""
-"假设寄存器分配器选择将 `x` 分配到 `ax` 寄存器。`h` 修饰符将生成该寄存器高字节的名称,而 `l` 修饰符将生成低字节的名称。因此,汇编代码将被展开为 `mov ah, al`,这条指令将值的低字节复制到高字节。"
+"假设寄存器分配器选择将 `x` 分配到 `ax` 寄存器。`h` 修饰符将生成该寄存器高字节"
+"的名称,而 `l` 修饰符将生成低字节的名称。因此,汇编代码将被展开为 `mov ah, "
+"al`,这条指令将值的低字节复制到高字节。"
-#: src/unsafe/asm.md:385
+#: src/unsafe/asm.md:394
msgid ""
-"If you use a smaller data type (e.g. `u16`) with an operand and forget to use "
-"template modifiers, the compiler will emit a warning and suggest the correct "
-"modifier to use."
+"If you use a smaller data type (e.g. `u16`) with an operand and forget to "
+"use template modifiers, the compiler will emit a warning and suggest the "
+"correct modifier to use."
msgstr ""
-"如果你对操作数使用较小的数据类型(例如 `u16`)并忘记使用模板修饰符,编译器将发出警告并建议使用正确的修饰符。"
+"如果你对操作数使用较小的数据类型(例如 `u16`)并忘记使用模板修饰符,编译器将"
+"发出警告并建议使用正确的修饰符。"
-#: src/unsafe/asm.md:387
+#: src/unsafe/asm.md:396
msgid "Memory address operands"
msgstr "内存地址操作数"
-#: src/unsafe/asm.md:389
+#: src/unsafe/asm.md:398
msgid ""
"Sometimes assembly instructions require operands passed via memory addresses/"
"memory locations. You have to manually use the memory address syntax "
@@ -16369,58 +17006,62 @@
"assembly syntax, you should wrap inputs/outputs in `[]` to indicate they are "
"memory operands:"
msgstr ""
-"有时汇编指令需要通过内存地址或内存位置传递操作数。你必须手动使用目标架构指定的内存地址语法。例如,在使用 Intel 汇编语法的 x86/x86_64 架构上,你应该用 `[]` 包裹输入/输出,以表明它们是内存操作数:"
+"有时汇编指令需要通过内存地址或内存位置传递操作数。你必须手动使用目标架构指定"
+"的内存地址语法。例如,在使用 Intel 汇编语法的 x86/x86_64 架构上,你应该用 "
+"`[]` 包裹输入/输出,以表明它们是内存操作数:"
-#: src/unsafe/asm.md:399
+#: src/unsafe/asm.md:408
msgid "\"fldcw [{}]\""
msgstr "\"fldcw [{}]\""
-#: src/unsafe/asm.md:405
+#: src/unsafe/asm.md:414
msgid "Labels"
msgstr "标签"
-#: src/unsafe/asm.md:407
+#: src/unsafe/asm.md:416
msgid ""
-"Any reuse of a named label, local or otherwise, can result in an assembler or "
-"linker error or may cause other strange behavior. Reuse of a named label can "
-"happen in a variety of ways including:"
+"Any reuse of a named label, local or otherwise, can result in an assembler "
+"or linker error or may cause other strange behavior. Reuse of a named label "
+"can happen in a variety of ways including:"
msgstr ""
-"重复使用命名标签(无论是局部的还是其他类型的)可能导致汇编器或链接器错误,或引起其他异常行为。命名标签的重用可能以多种方式发生,包括:"
+"重复使用命名标签(无论是局部的还是其他类型的)可能导致汇编器或链接器错误,或"
+"引起其他异常行为。命名标签的重用可能以多种方式发生,包括:"
-#: src/unsafe/asm.md:409
+#: src/unsafe/asm.md:418
msgid ""
"explicitly: using a label more than once in one `asm!` block, or multiple "
"times across blocks."
-msgstr ""
-"显式重用:在一个 `asm!` 块中多次使用同一标签,或在多个块之间重复使用。"
+msgstr "显式重用:在一个 `asm!` 块中多次使用同一标签,或在多个块之间重复使用。"
-#: src/unsafe/asm.md:410
+#: src/unsafe/asm.md:419
msgid ""
"implicitly via inlining: the compiler is allowed to instantiate multiple "
"copies of an `asm!` block, for example when the function containing it is "
"inlined in multiple places."
msgstr ""
-"通过内联隐式重用:编译器可能会创建 `asm!` 块的多个副本,例如当包含该块的函数在多处被内联时。"
+"通过内联隐式重用:编译器可能会创建 `asm!` 块的多个副本,例如当包含该块的函数"
+"在多处被内联时。"
-#: src/unsafe/asm.md:411
+#: src/unsafe/asm.md:420
msgid ""
"implicitly via LTO: LTO can cause code from _other crates_ to be placed in "
"the same codegen unit, and so could bring in arbitrary labels."
msgstr ""
-"通过 LTO 隐式重用:链接时优化(LTO)可能导致**其他 crate** 的代码被放置在同一代码生成单元中,从而可能引入任意标签。"
+"通过 LTO 隐式重用:链接时优化(LTO)可能导致**其他 crate** 的代码被放置在同一"
+"代码生成单元中,从而可能引入任意标签。"
-#: src/unsafe/asm.md:413
+#: src/unsafe/asm.md:422
msgid ""
-"As a consequence, you should only use GNU assembler **numeric** [local labels]"
-"(https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-Labels) "
-"inside inline assembly code. Defining symbols in assembly code may lead to "
-"assembler and/or linker errors due to duplicate symbol definitions."
+"As a consequence, you should only use GNU assembler **numeric** [local "
+"labels](https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-"
+"Labels) inside inline assembly code. Defining symbols in assembly code may "
+"lead to assembler and/or linker errors due to duplicate symbol definitions."
msgstr ""
-"因此,你应该只在内联汇编代码中使用 GNU 汇编器的**数字**[局部标签]"
-"(https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-Labels)。"
-"在汇编代码中定义符号可能会由于重复的符号定义而导致汇编器和/或链接器错误。"
+"因此,你应该只在内联汇编代码中使用 GNU 汇编器的**数字**[局部标签](https://"
+"sourceware.org/binutils/docs/as/Symbol-Names.html#Local-Labels)。在汇编代码中"
+"定义符号可能会由于重复的符号定义而导致汇编器和/或链接器错误。"
-#: src/unsafe/asm.md:415
+#: src/unsafe/asm.md:424
msgid ""
"Moreover, on x86 when using the default Intel syntax, due to [an LLVM bug]"
"(https://bugs.llvm.org/show_bug.cgi?id=36144), you shouldn't use labels "
@@ -16429,140 +17070,149 @@
"will avoid any ambiguity, but that affects the syntax of the _entire_ `asm!` "
"block. (See [Options](#options), below, for more on `options`.)"
msgstr ""
-"此外,在 x86 架构上使用默认的 Intel 语法时,由于[一个 LLVM 的 bug]"
-"(https://bugs.llvm.org/show_bug.cgi?id=36144),你不应使用仅由 `0` 和 `1` 组成的标签,"
-"如 `0`、`11` 或 `101010`,因为它们可能被误解为二进制值。使用 `options(att_syntax)` "
-"可以避免这种歧义,但这会影响*整个* `asm!` 块的语法。(关于 `options` 的更多信息,"
-"请参见下文的[选项](#options)。)"
+"此外,在 x86 架构上使用默认的 Intel 语法时,由于[一个 LLVM 的 bug](https://"
+"bugs.llvm.org/show_bug.cgi?id=36144),你不应使用仅由 `0` 和 `1` 组成的标签,"
+"如 `0`、`11` 或 `101010`,因为它们可能被误解为二进制值。使用 "
+"`options(att_syntax)` 可以避免这种歧义,但这会影响*整个* `asm!` 块的语法。"
+"(关于 `options` 的更多信息,请参见下文的[选项](#options)。)"
-#: src/unsafe/asm.md:424
+#: src/unsafe/asm.md:433
msgid "\"mov {0}, 10\""
msgstr "\"mov {0}, 10\""
-#: src/unsafe/asm.md:425 src/unsafe/asm.md:430
+#: src/unsafe/asm.md:434 src/unsafe/asm.md:439
msgid "\"2:\""
msgstr "\"2:\""
-#: src/unsafe/asm.md:426
+#: src/unsafe/asm.md:435
msgid "\"sub {0}, 1\""
msgstr "\"sub {0}, 1\""
-#: src/unsafe/asm.md:427
+#: src/unsafe/asm.md:436
msgid "\"cmp {0}, 3\""
msgstr "\"cmp {0}, 3\""
-#: src/unsafe/asm.md:428
+#: src/unsafe/asm.md:437
msgid "\"jle 2f\""
msgstr "\"jle 2f\""
-#: src/unsafe/asm.md:429
+#: src/unsafe/asm.md:438
msgid "\"jmp 2b\""
msgstr "\"jmp 2b\""
-#: src/unsafe/asm.md:431
+#: src/unsafe/asm.md:440
msgid "\"add {0}, 2\""
msgstr "\"add {0}, 2\""
-#: src/unsafe/asm.md:439
+#: src/unsafe/asm.md:448
msgid ""
"This will decrement the `{0}` register value from 10 to 3, then add 2 and "
"store it in `a`."
msgstr ""
"这段代码会将 `{0}` 寄存器的值从 10 递减到 3,然后加 2 并将结果存储在 `a` 中。"
-#: src/unsafe/asm.md:441
+#: src/unsafe/asm.md:450
msgid "This example shows a few things:"
msgstr "这个例子展示了几个要点:"
-#: src/unsafe/asm.md:443
+#: src/unsafe/asm.md:452
msgid ""
-"First, that the same number can be used as a label multiple times in the same "
-"inline block."
+"First, that the same number can be used as a label multiple times in the "
+"same inline block."
msgstr "首先,同一个数字可以在同一个内联块中多次用作标签。"
-#: src/unsafe/asm.md:444
+#: src/unsafe/asm.md:453
+
msgid ""
"Second, that when a numeric label is used as a reference (as an instruction "
-"operand, for example), the suffixes "b" ("backward") or "f" ("forward") "
-"should be added to the numeric label. It will then refer to the nearest label "
-"defined by this number in this direction."
+"operand, for example), the suffixes “b” (“backward”) or ”f” (“forward”) "
+"should be added to the numeric label. It will then refer to the nearest "
+"label defined by this number in this direction."
msgstr ""
-"其次,当数字标签被用作引用(例如作为指令操作数)时,应在数字标签后添加后缀 "b"("backward",向后)"
-"或 "f"("forward",向前)。这样它将引用该方向上由这个数字定义的最近的标签。"
+"其次,当数字标签被用作引用(例如作为指令操作数)时,应在数字标签后添加后缀 "
+"\"b\"(\"backward\",向后)或 \"f\"(\"forward\",向前)。这样它将引用该方向"
+"上由这个数字定义的最近的标签。"
-#: src/unsafe/asm.md:449
+#: src/unsafe/asm.md:458
msgid "Options"
msgstr "选项"
-#: src/unsafe/asm.md:451
+#: src/unsafe/asm.md:460
msgid ""
"By default, an inline assembly block is treated the same way as an external "
-"FFI function call with a custom calling convention: it may read/write memory, "
-"have observable side effects, etc. However, in many cases it is desirable to "
-"give the compiler more information about what the assembly code is actually "
-"doing so that it can optimize better."
+"FFI function call with a custom calling convention: it may read/write "
+"memory, have observable side effects, etc. However, in many cases it is "
+"desirable to give the compiler more information about what the assembly code "
+"is actually doing so that it can optimize better."
msgstr ""
-"默认情况下,内联汇编块的处理方式与具有自定义调用约定的外部 FFI 函数调用相同:它可能读写内存,"
-"产生可观察的副作用等。然而,在许多情况下,我们希望向编译器提供更多关于汇编代码实际行为的信息,"
-"以便编译器能够进行更好的优化。"
+"默认情况下,内联汇编块的处理方式与具有自定义调用约定的外部 FFI 函数调用相同:"
+"它可能读写内存,产生可观察的副作用等。然而,在许多情况下,我们希望向编译器提"
+"供更多关于汇编代码实际行为的信息,以便编译器能够进行更好的优化。"
-#: src/unsafe/asm.md:453
+#: src/unsafe/asm.md:462
msgid "Let's take our previous example of an `add` instruction:"
msgstr "让我们回顾一下之前 `add` 指令的例子:"
-#: src/unsafe/asm.md:472
+#: src/unsafe/asm.md:481
msgid ""
-"Options can be provided as an optional final argument to the `asm!` macro. We "
-"specified three options here:"
+"Options can be provided as an optional final argument to the `asm!` macro. "
+"We specified three options here:"
msgstr ""
-"可以将选项作为可选的最后一个参数传递给 `asm!` 宏。在这个例子中,我们指定了三个选项:"
+"可以将选项作为可选的最后一个参数传递给 `asm!` 宏。在这个例子中,我们指定了三"
+"个选项:"
-#: src/unsafe/asm.md:473
+#: src/unsafe/asm.md:483
msgid ""
"`pure` means that the asm code has no observable side effects and that its "
-"output depends only on its inputs. This allows the compiler optimizer to call "
-"the inline asm fewer times or even eliminate it entirely."
+"output depends only on its inputs. This allows the compiler optimizer to "
+"call the inline asm fewer times or even eliminate it entirely."
msgstr ""
-"`pure`:表示汇编代码没有可观察的副作用,其输出仅依赖于输入。这使得编译器优化器能够减少内联汇编的调用次数,甚至完全消除它。"
+"`pure`:表示汇编代码没有可观察的副作用,其输出仅依赖于输入。这使得编译器优化"
+"器能够减少内联汇编的调用次数,甚至完全消除它。"
-#: src/unsafe/asm.md:474
+#: src/unsafe/asm.md:484
msgid ""
"`nomem` means that the asm code does not read or write to memory. By default "
"the compiler will assume that inline assembly can read or write any memory "
"address that is accessible to it (e.g. through a pointer passed as an "
"operand, or a global)."
msgstr ""
-"`nomem`:表示汇编代码不读取或写入内存。默认情况下,编译器会假设内联汇编可以读写任何它可访问的内存地址(例如通过作为操作数传递的指针或全局变量)。"
+"`nomem`:表示汇编代码不读取或写入内存。默认情况下,编译器会假设内联汇编可以读"
+"写任何它可访问的内存地址(例如通过作为操作数传递的指针或全局变量)。"
-#: src/unsafe/asm.md:475
+#: src/unsafe/asm.md:485
msgid ""
-"`nostack` means that the asm code does not push any data onto the stack. This "
-"allows the compiler to use optimizations such as the stack red zone on x86-64 "
-"to avoid stack pointer adjustments."
+"`nostack` means that the asm code does not push any data onto the stack. "
+"This allows the compiler to use optimizations such as the stack red zone on "
+"x86-64 to avoid stack pointer adjustments."
msgstr ""
-"`nostack`:表示汇编代码不会向栈中压入任何数据。这允许编译器使用诸如 x86-64 上的栈红区等优化技术,以避免栈指针调整。"
+"`nostack`:表示汇编代码不会向栈中压入任何数据。这允许编译器使用诸如 x86-64 上"
+"的栈红区等优化技术,以避免栈指针调整。"
-#: src/unsafe/asm.md:477
+#: src/unsafe/asm.md:487
msgid ""
-"These allow the compiler to better optimize code using `asm!`, for example by "
-"eliminating pure `asm!` blocks whose outputs are not needed."
+"These allow the compiler to better optimize code using `asm!`, for example "
+"by eliminating pure `asm!` blocks whose outputs are not needed."
msgstr ""
-"这些选项使编译器能够更好地优化使用 `asm!` 的代码,例如消除那些输出未被使用的纯 `asm!` 块。"
+"这些选项使编译器能够更好地优化使用 `asm!` 的代码,例如消除那些输出未被使用的"
+"纯 `asm!` 块。"
-#: src/unsafe/asm.md:479
+#: src/unsafe/asm.md:489
msgid ""
"See the [reference](https://doc.rust-lang.org/stable/reference/inline-"
"assembly.html) for the full list of available options and their effects."
msgstr ""
-"有关可用选项的完整列表及其效果,请参阅[参考文档](https://doc.rust-lang.org/stable/reference/inline-assembly.html)。"
+"有关可用选项的完整列表及其效果,请参阅[参考文档](https://doc.rust-lang.org/"
+"stable/reference/inline-assembly.html)。"
#: src/compatibility.md:3
msgid ""
-"The Rust language is fastly evolving, and because of this certain "
+"The Rust language is evolving rapidly, and because of this certain "
"compatibility issues can arise, despite efforts to ensure forwards-"
"compatibility wherever possible."
msgstr ""
-"Rust 语言正在快速发展。尽管我们努力确保尽可能的向前兼容,但某些兼容性问题仍可能出现。"
+"Rust 语言正在快速发展,因此某些兼容性问题可能会出现,尽管我们努力确保尽可能"
+"的向前兼容。"
#: src/compatibility.md:7
msgid "[Raw identifiers](compatibility/raw_identifiers.md)"
@@ -16570,24 +17220,29 @@
#: src/compatibility/raw_identifiers.md:3
msgid ""
-"Rust, like many programming languages, has the concept of \"keywords\". These "
-"identifiers mean something to the language, and so you cannot use them in "
-"places like variable names, function names, and other places. Raw identifiers "
-"let you use keywords where they would not normally be allowed. This is "
-"particularly useful when Rust introduces new keywords, and a library using an "
-"older edition of Rust has a variable or function with the same name as a "
-"keyword introduced in a newer edition."
+"Rust, like many programming languages, has the concept of \"keywords\". "
+"These identifiers mean something to the language, and so you cannot use them "
+"in places like variable names, function names, and other places. Raw "
+"identifiers let you use keywords where they would not normally be allowed. "
+"This is particularly useful when Rust introduces new keywords, and a library "
+"using an older edition of Rust has a variable or function with the same name "
+"as a keyword introduced in a newer edition."
msgstr ""
-"Rust 和许多编程语言一样,有"关键字"的概念。这些标识符在语言中具有特殊含义,因此你不能在变量名、函数名等地方使用它们。原始标识符允许你在通常不允许使用关键字的地方使用它们。这在 Rust 引入新关键字,而使用旧版本 Rust 的库中有与新版本引入的关键字同名的变量或函数时特别有用。"
+"Rust 和许多编程语言一样,有\"关键字\"的概念。这些标识符在语言中具有特殊含义,"
+"因此你不能在变量名、函数名等地方使用它们。原始标识符允许你在通常不允许使用关"
+"键字的地方使用它们。这在 Rust 引入新关键字,而使用旧版本 Rust 的库中有与新版"
+"本引入的关键字同名的变量或函数时特别有用。"
#: src/compatibility/raw_identifiers.md:11
msgid ""
"For example, consider a crate `foo` compiled with the 2015 edition of Rust "
"that exports a function named `try`. This keyword is reserved for a new "
-"feature in the 2018 edition, so without raw identifiers, we would have no way "
-"to name the function."
+"feature in the 2018 edition, so without raw identifiers, we would have no "
+"way to name the function."
msgstr ""
-"例如,假设有一个使用 Rust 2015 版编译的 crate `foo`,它导出了一个名为 `try` 的函数。这个关键字在 2018 版中被保留用于新特性,如果没有原始标识符,我们就无法命名这个函数。"
+"例如,假设有一个使用 Rust 2015 版编译的 crate `foo`,它导出了一个名为 `try` "
+"的函数。这个关键字在 2018 版中被保留用于新特性,如果没有原始标识符,我们就无"
+"法命名这个函数。"
#: src/compatibility/raw_identifiers.md:24
msgid "You'll get this error:"
@@ -16603,41 +17258,41 @@
"tooling or infrastructure support which just makes things better for "
"everyone. These topics include:"
msgstr ""
-"有些主题虽然与程序如何运行不直接相关,但它们提供了工具或基础设施支持,使得整个开发生态变得更好。这些主题包括:"
+"有些主题虽然与程序如何运行不直接相关,但它们提供了工具或基础设施支持,使得整"
+"个开发生态变得更好。这些主题包括:"
#: src/meta.md:7
msgid ""
"[Documentation](meta/doc.md): Generate library documentation for users via "
"the included `rustdoc`."
-msgstr ""
-"[文档](meta/doc.md):使用内置的 `rustdoc` 为用户生成库文档。"
+msgstr "[文档](meta/doc.md):使用内置的 `rustdoc` 为用户生成库文档。"
#: src/meta.md:9
msgid ""
"[Playground](meta/playground.md): Integrate the Rust Playground in your "
"documentation."
-msgstr ""
-"[Playground](meta/playground.md):在文档中集成 Rust Playground。"
+msgstr "[Playground](meta/playground.md):在文档中集成 Rust Playground。"
#: src/meta/doc.md:3
msgid ""
"Use `cargo doc` to build documentation in `target/doc`, `cargo doc --open` "
"will automatically open it in your web browser."
msgstr ""
-"使用 `cargo doc` 在 `target/doc` 目录下构建文档。运行 `cargo doc --open` 将自动在浏览器中打开文档。"
+"使用 `cargo doc` 在 `target/doc` 目录下构建文档。运行 `cargo doc --open` 将自"
+"动在浏览器中打开文档。"
#: src/meta/doc.md:6
msgid ""
-"Use `cargo test` to run all tests (including documentation tests), and `cargo "
-"test --doc` to only run documentation tests."
+"Use `cargo test` to run all tests (including documentation tests), and "
+"`cargo test --doc` to only run documentation tests."
msgstr ""
-"使用 `cargo test` 运行所有测试(包括文档测试)。如果只想运行文档测试,请使用 `cargo test --doc`。"
+"使用 `cargo test` 运行所有测试(包括文档测试)。如果只想运行文档测试,请使用 "
+"`cargo test --doc`。"
#: src/meta/doc.md:9
msgid ""
"These commands will appropriately invoke `rustdoc` (and `rustc`) as required."
-msgstr ""
-"这些命令会根据需要适当地调用 `rustdoc`(和 `rustc`)。"
+msgstr "这些命令会根据需要适当地调用 `rustdoc`(和 `rustc`)。"
#: src/meta/doc.md:11
msgid "Doc comments"
@@ -16647,10 +17302,12 @@
msgid ""
"Doc comments are very useful for big projects that require documentation. "
"When running `rustdoc`, these are the comments that get compiled into "
-"documentation. They are denoted by a `///`, and support [Markdown](https://en."
-"wikipedia.org/wiki/Markdown)."
+"documentation. They are denoted by a `///`, and support [Markdown](https://"
+"en.wikipedia.org/wiki/Markdown)."
msgstr ""
-"文档注释对需要文档的大型项目非常有用。运行 `rustdoc` 时,这些注释会被编译成文档。文档注释以 `///` 开头,并支持 [Markdown](https://zh.wikipedia.org/wiki/Markdown) 语法。"
+"文档注释对需要文档的大型项目非常有用。运行 `rustdoc` 时,这些注释会被编译成文"
+"档。文档注释以 `///` 开头,并支持 [Markdown](https://zh.wikipedia.org/wiki/"
+"Markdown) 语法。"
#: src/meta/doc.md:18
msgid "\"doc\""
@@ -16697,7 +17354,7 @@
msgstr ""
"/// 给出友好的问候!\n"
" ///\n"
-" /// 对调用此方法的 `Person` 说 "Hello, [name](Person::name)"。\n"
+" /// 对调用此方法的 `Person` 说 \"Hello, [name](Person::name)\"。\n"
#: src/meta/doc.md:47
msgid "\"Hello, {}!\""
@@ -16712,7 +17369,8 @@
"To run the tests, first build the code as a library, then tell `rustdoc` "
"where to find the library so it can link it into each doctest program:"
msgstr ""
-"要运行测试,首先将代码构建为库,然后告诉 `rustdoc` 库的位置,以便它可以将库链接到每个文档测试程序中:"
+"要运行测试,首先将代码构建为库,然后告诉 `rustdoc` 库的位置,以便它可以将库链"
+"接到每个文档测试程序中:"
#: src/meta/doc.md:61
msgid ""
@@ -16781,15 +17439,17 @@
"For documentation, `rustdoc` is widely used by the community. It's what is "
"used to generate the [std library docs](https://doc.rust-lang.org/std/)."
msgstr ""
-"在文档生成方面,`rustdoc` 被社区广泛使用。它是用来生成 [标准库文档](https://doc.rust-lang.org/std/) 的工具。"
+"在文档生成方面,`rustdoc` 被社区广泛使用。它是用来生成 [标准库文档](https://"
+"doc.rust-lang.org/std/) 的工具。"
#: src/meta/doc.md:111
msgid ""
-"[The Rust Book: Making Useful Documentation Comments](https://doc.rust-lang."
-"org/book/ch14-02-publishing-to-crates-io.html#making-useful-documentation-"
-"comments)"
+"[The Rust Book: Making Useful Documentation Comments](https://doc.rust-"
+"lang.org/book/ch14-02-publishing-to-crates-io.html#making-useful-"
+"documentation-comments)"
msgstr ""
-"[《Rust 程序设计语言》:编写有用的文档注释](https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#making-useful-documentation-comments)"
+"[《Rust 程序设计语言》:编写有用的文档注释](https://doc.rust-lang.org/book/"
+"ch14-02-publishing-to-crates-io.html#making-useful-documentation-comments)"
#: src/meta/doc.md:112
msgid "[The rustdoc Book](https://doc.rust-lang.org/rustdoc/index.html)"
@@ -16800,37 +17460,42 @@
"[The Reference: Doc comments](https://doc.rust-lang.org/stable/reference/"
"comments.html#doc-comments)"
msgstr ""
-"[Rust 参考手册:文档注释](https://doc.rust-lang.org/stable/reference/comments.html#doc-comments)"
+"[Rust 参考手册:文档注释](https://doc.rust-lang.org/stable/reference/"
+"comments.html#doc-comments)"
#: src/meta/doc.md:114
msgid ""
-"[RFC 1574: API Documentation Conventions](https://rust-lang.github.io/"
-"rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-"
+"[RFC 1574: API Documentation Conventions](https://rust-lang.github.io/rfcs/"
+"1574-more-api-documentation-conventions.html#appendix-a-full-conventions-"
"text)"
msgstr ""
-"[RFC 1574:API 文档约定](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text)"
+"[RFC 1574:API 文档约定](https://rust-lang.github.io/rfcs/1574-more-api-"
+"documentation-conventions.html#appendix-a-full-conventions-text)"
#: src/meta/doc.md:115
msgid ""
"[RFC 1946: Relative links to other items from doc comments (intra-rustdoc "
"links)](https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html)"
msgstr ""
-"[RFC 1946:文档注释中的相对链接(rustdoc 内部链接)](https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html)"
+"[RFC 1946:文档注释中的相对链接(rustdoc 内部链接)](https://rust-"
+"lang.github.io/rfcs/1946-intra-rustdoc-links.html)"
#: src/meta/doc.md:116
msgid ""
-"[Is there any documentation style guide for comments? (reddit)](https://www."
-"reddit.com/r/rust/comments/ahb50s/is_there_any_documentation_style_guide_for/)"
+"[Is there any documentation style guide for comments? (reddit)](https://"
+"www.reddit.com/r/rust/comments/ahb50s/"
+"is_there_any_documentation_style_guide_for/)"
msgstr ""
-"[有关注释的文档风格指南?(Reddit 讨论)](https://www."
-"reddit.com/r/rust/comments/ahb50s/is_there_any_documentation_style_guide_for/)"
+"[有关注释的文档风格指南?(Reddit 讨论)](https://www.reddit.com/r/rust/"
+"comments/ahb50s/is_there_any_documentation_style_guide_for/)"
#: src/meta/playground.md:3
msgid ""
"The [Rust Playground](https://play.rust-lang.org/) is a way to experiment "
"with Rust code through a web interface."
msgstr ""
-"[Rust Playground](https://play.rust-lang.org/) 是一个通过网页界面体验 Rust 代码的平台。"
+"[Rust Playground](https://play.rust-lang.org/) 是一个通过网页界面体验 Rust 代"
+"码的平台。"
#: src/meta/playground.md:6
msgid "Using it with `mdbook`"
@@ -16841,22 +17506,25 @@
"In [`mdbook`](https://github.com/rust-lang/mdBook), you can make code "
"examples playable and editable."
msgstr ""
-"在 [`mdbook`](https://github.com/rust-lang/mdBook) 中,你可以让代码示例变得可运行和可编辑。"
+"在 [`mdbook`](https://github.com/rust-lang/mdBook) 中,你可以让代码示例变得可"
+"运行和可编辑。"
#: src/meta/playground.md:16
msgid ""
"This allows the reader to both run your code sample, but also modify and "
-"tweak it. The key here is the adding of the word `editable` to your codefence "
-"block separated by a comma."
+"tweak it. The key here is the adding of the word `editable` to your "
+"codefence block separated by a comma."
msgstr ""
-"这不仅允许读者运行你的代码示例,还能修改和调整它。关键是在代码块标记中添加 `editable` 关键字,用逗号分隔。"
+"这不仅允许读者运行你的代码示例,还能修改和调整它。关键是在代码块标记中添加 "
+"`editable` 关键字,用逗号分隔。"
#: src/meta/playground.md:26
msgid ""
"Additionally, you can add `ignore` if you want `mdbook` to skip your code "
"when it builds and tests."
msgstr ""
-"此外,如果你希望 `mdbook` 在构建和测试时跳过某段代码,可以添加 `ignore` 关键字。"
+"此外,如果你希望 `mdbook` 在构建和测试时跳过某段代码,可以添加 `ignore` 关键"
+"字。"
#: src/meta/playground.md:35
msgid "Using it with docs"
@@ -16865,25 +17533,27 @@
#: src/meta/playground.md:37
msgid ""
"You may have noticed in some of the [official Rust docs](https://doc.rust-"
-"lang.org/core/) a button that says \"Run\", which opens the code sample up in "
-"a new tab in Rust Playground. This feature is enabled if you use the `#[doc]` "
-"attribute called [`html_playground_url`](https://doc.rust-lang.org/rustdoc/"
-"write-documentation/the-doc-attribute.html#html_playground_url)."
+"lang.org/core/) a button that says \"Run\", which opens the code sample up "
+"in a new tab in Rust Playground. This feature is enabled if you use the "
+"`#[doc]` attribute called [`html_playground_url`](https://doc.rust-lang.org/"
+"rustdoc/write-documentation/the-doc-attribute.html#html_playground_url)."
msgstr ""
-"你可能注意到在一些[官方 Rust 文档](https://doc.rust-lang.org/core/)中有一个"运行"按钮,"
-"点击后会在 Rust Playground 的新标签页中打开代码示例。要启用此功能,需要使用 `#[doc]` 属性中的 "
-"[`html_playground_url`](https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#html_playground_url)。"
+"你可能注意到在一些[官方 Rust 文档](https://doc.rust-lang.org/core/)中有一个"
+"\"运行\"按钮,点击后会在 Rust Playground 的新标签页中打开代码示例。要启用此功"
+"能,需要使用 `#[doc]` 属性中的 [`html_playground_url`](https://doc.rust-"
+"lang.org/rustdoc/write-documentation/the-doc-"
+"attribute.html#html_playground_url)。"
#: src/meta/playground.md:42
msgid ""
-"````\n"
+"````text\n"
"#![doc(html_playground_url = \"https://play.rust-lang.org/\")]\n"
"//! ```\n"
"//! println!(\"Hello World\");\n"
"//! ```\n"
"````"
msgstr ""
-"````\n"
+"````text\n"
"#![doc(html_playground_url = \"https://play.rust-lang.org/\")]\n"
"//! ```\n"
"//! println!(\"Hello World\");\n"
@@ -16899,10 +17569,15 @@
"[The Rust Playground On Github](https://github.com/integer32llc/rust-"
"playground/)"
msgstr ""
-"[GitHub 上的 Rust Playground](https://github.com/integer32llc/rust-playground/)"
+"[GitHub 上的 Rust Playground](https://github.com/integer32llc/rust-"
+"playground/)"
#: src/meta/playground.md:53
msgid ""
"[The rustdoc Book](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html)"
-msgstr ""
-"[rustdoc 手册](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html)"
+msgstr "[rustdoc 手册](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html)"
+
+#~ msgid ""
+#~ "The compiler forbids use of uninitialized variables, as this would lead "
+#~ "to undefined behavior."
+#~ msgstr "编译器禁止使用未初始化的变量,因为这会导致未定义行为。"