@@ -4994,22 +4994,23 @@ msgstr ""
4994
4994
4995
4995
#: src/flow_control/let_else.md:4
4996
4996
msgid "🛈 stable since: rust 1.65"
4997
- msgstr "🛈 自 rust 1.65 版本起稳定"
4997
+ msgstr "🛈 自 Rust 1.65 版本起稳定"
4998
4998
4999
4999
#: src/flow_control/let_else.md:6
5000
5000
msgid ""
5001
5001
"🛈 you can target specific edition by compiling like this `rustc --"
5002
5002
"edition=2021 main.rs`"
5003
5003
msgstr ""
5004
- "🛈 你可以通过这样编译来指定特定版本 `rustc --edition=2021 main.rs`"
5004
+ "🛈 你可以通过这种方式编译来指定特定版本: `rustc --edition=2021 main.rs`"
5005
5005
5006
5006
#: src/flow_control/let_else.md:10
5007
5007
msgid ""
5008
5008
"With `let`\\-`else`, a refutable pattern can match and bind variables in the "
5009
5009
"surrounding scope like a normal `let`, or else diverge (e.g. `break`, "
5010
5010
"`return`, `panic!`) when the pattern doesn't match."
5011
5011
msgstr ""
5012
- "使用 `let`\\-`else`,可反驳模式可以像普通的 `let` 一样匹配并绑定周围作用域中的变量,或者在模式不匹配时发散(例如 `break`、`return`、`panic!`)。"
5012
+ "`let`-`else` 语法允许可能失败的模式匹配像普通 `let` 一样绑定变量到当前作用域,"
5013
+ "或在匹配失败时执行中断操作(如 `break`、`return`、`panic!`)。"
5013
5014
5014
5015
#: src/flow_control/let_else.md:18 src/flow_control/let_else.md:41
5015
5016
#: src/std/str.md:41
@@ -5038,30 +5039,32 @@ msgid ""
5038
5039
"`match` or `if let`\\-`else` expressions. You could previously approximate "
5039
5040
"these patterns with an unfortunate bit of repetition and an outer `let`:"
5040
5041
msgstr ""
5041
- "名称绑定的作用域是使其与 `match` 或 `if let`\\-`else` 表达式不同的主要原因。你之前可以通过一些冗余的重复和外部的 `let` 来近似这些模式:"
5042
+ "名称绑定的作用域是使其区别于 `match` 或 `if let`-`else` 表达式的主要特点。"
5043
+ "在此之前,你可能需要通过一些冗余的重复和外部 `let` 来近似实现这些模式:"
5042
5044
5043
5045
#: src/flow_control/let_else.md:59
5044
5046
msgid ""
5045
5047
"[option](../std/option.md), [match](./match.md), [if let](./if_let.md) and "
5046
5048
"the [let-else RFC](https://rust-lang.github.io/rfcs/3137-let-else.html)."
5047
5049
msgstr ""
5048
- "[option ](../std/option.md), [match](./match.md), [if let](./if_let.md) 和 "
5050
+ "[Option ](../std/option.md)、 [match](./match.md)、 [if let](./if_let.md) 和 "
5049
5051
"[let-else RFC](https://rust-lang.github.io/rfcs/3137-let-else.html)。"
5050
5052
5051
5053
#: src/flow_control/while_let.md:3
5052
5054
msgid ""
5053
5055
"Similar to `if let`, `while let` can make awkward `match` sequences more "
5054
5056
"tolerable. Consider the following sequence that increments `i`:"
5055
5057
msgstr ""
5056
- "与 `if let` 类似,`while let` 可以使别扭的 `match` 序列更易于处理。考虑下面这个递增 `i` 的序列:"
5058
+ "与 `if let` 类似,`while let` 可以简化繁琐的 `match` 序列。"
5059
+ "让我们来看一个递增 `i` 的例子:"
5057
5060
5058
5061
#: src/flow_control/while_let.md:9
5059
5062
msgid "// Repeatedly try this test.\n"
5060
- msgstr "// 重复尝试这个测试 。\n"
5063
+ msgstr "// 重复执行此测试 。\n"
5061
5064
5062
5065
#: src/flow_control/while_let.md:13
5063
5066
msgid "// If `optional` destructures, evaluate the block.\n"
5064
- msgstr "// 如果 `optional` 解构成功,就执行语句块 。\n"
5067
+ msgstr "// 如果 `optional` 解构成功,则执行代码块 。\n"
5065
5068
5066
5069
#: src/flow_control/while_let.md:16 src/flow_control/while_let.md:42
5067
5070
msgid "\"Greater than 9, quit!\""
@@ -5081,41 +5084,33 @@ msgstr "// 当解构失败时退出循环:\n"
5081
5084
5082
5085
#: src/flow_control/while_let.md:26
5083
5086
msgid "// ^ Why should this be required? There must be a better way!\n"
5084
- msgstr "// ^ 为什么这是必需的 ?一定有更好的方法!\n"
5087
+ msgstr "// ^ 为什么需要这样 ?一定有更好的方法!\n"
5085
5088
5086
5089
#: src/flow_control/while_let.md:31
5087
5090
msgid "Using `while let` makes this sequence much nicer:"
5088
- msgstr "使用 `while let` 使这个序列更加优雅 :"
5091
+ msgstr "使用 `while let` 可以让这个序列更加简洁 :"
5089
5092
5090
5093
#: src/flow_control/while_let.md:38
5091
5094
msgid ""
5092
5095
"// This reads: \"while `let` destructures `optional` into\n"
5093
5096
" // `Some(i)`, evaluate the block (`{}`). Else `break`.\n"
5094
5097
msgstr ""
5095
- "// 这读作 :当 `let` 把 `optional` 解构成 `Some(i)` 时,\n"
5096
- " // 执行语句块( `{}`)。 否则 `break`。\n"
5098
+ "// 这段代码的含义是 :当 `let` 将 `optional` 解构为 `Some(i)` 时,\n"
5099
+ " // 执行代码块 `{}`, 否则 `break`。\n"
5097
5100
5098
5101
#: src/flow_control/while_let.md:48
5099
5102
msgid ""
5100
5103
"// ^ Less rightward drift and doesn't require\n"
5101
5104
" // explicitly handling the failing case.\n"
5102
5105
msgstr ""
5103
-
5104
- #: src/flow_control/while_let.md:48
5105
- msgid ""
5106
- "// ^ Less rightward drift and doesn't require\n"
5107
- " // explicitly handling the failing case.\n"
5108
- msgstr ""
5109
- "// ^ 减少了向右偏移,并且不需要\n"
5110
- " // 显式处理失败的情况。\n"
5106
+ "// ^ 减少了代码缩进右移,无需显式处理失败情况\n"
5111
5107
5112
5108
#: src/flow_control/while_let.md:51
5113
5109
msgid ""
5114
5110
"// ^ `if let` had additional optional `else`/`else if`\n"
5115
5111
" // clauses. `while let` does not have these.\n"
5116
5112
msgstr ""
5117
- "// ^ `if let` 有额外的可选 `else`/`else if`\n"
5118
- " // 子句。`while let` 没有这些。\n"
5113
+ "// ^ `if let` 可以有额外的 `else`/`else if` 子句,`while let` 则没有。\n"
5119
5114
5120
5115
#: src/flow_control/while_let.md:58
5121
5116
msgid ""
@@ -5131,31 +5126,31 @@ msgid ""
5131
5126
"annotated, just like variables, and, if the function returns a value, the "
5132
5127
"return type must be specified after an arrow `->`."
5133
5128
msgstr ""
5134
- "函数使用 `fn` 关键字声明。它的参数需要标注类型 ,就像变量一样,如果函数返回一个值, "
5135
- "返回类型必须在箭头 `->` 之后指定 。"
5129
+ "函数使用 `fn` 关键字声明。函数参数需要标注类型 ,就像变量一样。 "
5130
+ "如果函数返回值,则必须在箭头 `->` 后指定返回类型 。"
5136
5131
5137
5132
#: src/fn.md:7
5138
5133
msgid ""
5139
5134
"The final expression in the function will be used as return value. "
5140
5135
"Alternatively, the `return` statement can be used to return a value earlier "
5141
5136
"from within the function, even from inside loops or `if` statements."
5142
5137
msgstr ""
5143
- "函数中的最后一个表达式将被用作返回值。或者 ,可以使用 `return` 语句从函数内部提前返回一个值 ,"
5144
- "甚至可以从循环或 `if` 语句内部返回 。"
5138
+ "函数的最后一个表达式将作为返回值。另外 ,可以使用 `return` 语句在函数内部提前返回值 ,"
5139
+ "甚至可以在循环或 `if` 语句内部使用 。"
5145
5140
5146
5141
#: src/fn.md:11
5147
5142
msgid "Let's rewrite FizzBuzz using functions!"
5148
- msgstr "让我们用函数重写 FizzBuzz!"
5143
+ msgstr "让我们用函数重写 FizzBuzz 吧 !"
5149
5144
5150
5145
#: src/fn.md:14
5151
5146
msgid ""
5152
5147
"// Unlike C/C++, there's no restriction on the order of function definitions\n"
5153
5148
msgstr ""
5154
- "// 与 C/C++ 不同,函数定义的顺序没有限制 \n"
5149
+ "// 与 C/C++ 不同,Rust 中函数定义的顺序没有限制 \n"
5155
5150
5156
5151
#: src/fn.md:16
5157
5152
msgid "// We can use this function here, and define it somewhere later\n"
5158
- msgstr "// 我们可以在这里使用这个函数,并在稍后的某个地方定义它 \n"
5153
+ msgstr "// 我们可以在这里使用函数,并在稍后的某处定义它 \n"
5159
5154
5160
5155
#: src/fn.md:19
5161
5156
msgid "// Function that returns a boolean value\n"
@@ -5167,14 +5162,14 @@ msgstr "// 特殊情况,提前返回\n"
5167
5162
5168
5163
#: src/fn.md:27
5169
5164
msgid "// This is an expression, the `return` keyword is not necessary here\n"
5170
- msgstr "// 这是一个表达式,这里不需要 `return` 关键字\n"
5165
+ msgstr "// 这是一个表达式,此处不需要 `return` 关键字\n"
5171
5166
5172
5167
#: src/fn.md:30
5173
5168
msgid ""
5174
5169
"// Functions that \"don't\" return a value, actually return the unit type "
5175
5170
"`()`\n"
5176
5171
msgstr ""
5177
- "// \"不\"返回值的函数实际上返回单元类型 `()`\n"
5172
+ "// \"无返回值\"的函数实际上返回单元类型 `()`\n"
5178
5173
5179
5174
#: src/fn.md:43
5180
5175
msgid ""
@@ -5194,8 +5189,8 @@ msgid ""
5194
5189
"are defined on a type generally, while methods are associated functions that "
5195
5190
"are called on a particular instance of a type."
5196
5191
msgstr ""
5197
- "有些函数与特定类型相关联 。这些函数有两种形式:关联函数和方法。关联函数是在类型上定义的函数, "
5198
- "而方法是在类型的特定实例上调用的关联函数。"
5192
+ "某些函数与特定类型相关联 。这些函数有两种形式:关联函数和方法。"
5193
+ "关联函数是在类型上定义的函数, 而方法是在类型的特定实例上调用的关联函数。"
5199
5194
5200
5195
#: src/fn/methods.md:13
5201
5196
msgid ""
0 commit comments