1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-20 21:18:26 +02:00

zh-Hans: Translation for src/basic-syntax/fnctions.md (#727)

This commit is contained in:
Riri 2023-06-01 09:42:09 +08:00 committed by GitHub
parent c4ce7b498e
commit 54ed5a322d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2880,13 +2880,14 @@ msgstr ""
#: src/basic-syntax/functions.md:1
msgid "# Functions"
msgstr ""
msgstr "# 函数(Functions)"
#: src/basic-syntax/functions.md:3
msgid ""
"A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/"
"Fizz_buzz) interview question:"
msgstr ""
"一个 Rust 版本的著名 [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) 面试题:"
#: src/basic-syntax/functions.md:5
msgid ""
@ -2932,6 +2933,11 @@ msgid ""
"* The range expression in the `for` loop in `print_fizzbuzz_to()` contains "
"`=n`, which causes it to include the upper bound."
msgstr ""
"* 我们在 `main` 中引用了下面编写的一个函数。不需要提前声明或添加头文件。 \n"
"* 类型跟随在声明的参数后(与某些编程语言相反),然后是返回类型。\n"
"* 函数体(或任何块)中的最后一个表达式将成为返回值。只需省略表达式末尾的 `;` 即可。\n"
"* 有些函数没有返回值,会返回“单元类型(unit type)”`()`。如果省略了`-> ()`的返回类型,编译器将会自动推断。\n"
"* `print_fizzbuzz_to()`函数中`for`循环的范围表达式(range expression)包含`=n`,这会导致它包括上限。"
#: src/basic-syntax/rustdoc.md:1
msgid "# Rustdoc"