1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-14 21:35:00 +02:00

vi:control-flow-basics/functions.md translations (#2031)

This commit is contained in:
Huy Vuong 2024-05-06 10:12:47 -06:00 committed by GitHub
parent 3cd28c3404
commit 31880ed327
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3412,6 +3412,8 @@ msgid ""
"Declaration parameters are followed by a type (the reverse of some " "Declaration parameters are followed by a type (the reverse of some "
"programming languages), then a return type." "programming languages), then a return type."
msgstr "" msgstr ""
"Những tham số phải được chú thích sau bằng một kiểu dữ liệu (ngược lại với "
"một số ngôn ngữ lập trình khác), rồi một giá trị trả về."
#: src/control-flow-basics/functions.md #: src/control-flow-basics/functions.md
msgid "" msgid ""
@ -3420,29 +3422,42 @@ msgid ""
"keyword can be used for early return, but the \"bare value\" form is " "keyword can be used for early return, but the \"bare value\" form is "
"idiomatic at the end of a function (refactor `gcd` to use a `return`)." "idiomatic at the end of a function (refactor `gcd` to use a `return`)."
msgstr "" msgstr ""
"Biểu thức cuối cùng trong hàm (hay một khối) sẽ trở thành giá trị tả về. Đơn "
"giản bằng cách bỏ qua dấu `;` ở cuối biểu thức. Từ khóa `return` có thể sử "
"dụng để trả về sớm, nhưng \"giá trị trần (bare value)\" là triết lí ngôn ngữ "
"(idiomatic) khi đặt ở cuối hàm (tái cấu trúc `gcd` dể sử dụng `return`)."
#: src/control-flow-basics/functions.md #: src/control-flow-basics/functions.md
msgid "" msgid ""
"Some functions have no return value, and return the 'unit type', `()`. The " "Some functions have no return value, and return the 'unit type', `()`. The "
"compiler will infer this if the `-> ()` return type is omitted." "compiler will infer this if the `-> ()` return type is omitted."
msgstr "" msgstr ""
"Một số hàm sẽ không có giá trị trở về, sẽ trả về 'kiểu dữ liệu', `()`. Trình "
"biên dịch sẽ kết luận rằng kiểu dữ liệu sẽ là `-> ()` nếu kiểu dữ liệu trả "
"về được bỏ qua."
#: src/control-flow-basics/functions.md #: src/control-flow-basics/functions.md
msgid "" msgid ""
"Overloading is not supported -- each function has a single implementation." "Overloading is not supported -- each function has a single implementation."
msgstr "" msgstr ""
"Overloading (nạp chồng) không được hỗ trợ -- mỗi hàm chỉ có duy nhất một "
"triển khai."
#: src/control-flow-basics/functions.md #: src/control-flow-basics/functions.md
msgid "" msgid ""
"Always takes a fixed number of parameters. Default arguments are not " "Always takes a fixed number of parameters. Default arguments are not "
"supported. Macros can be used to support variadic functions." "supported. Macros can be used to support variadic functions."
msgstr "" msgstr ""
"Luôn luôn lấy một số những tham số nhất định. Đối số mặc định không đưọc hỗ "
"trợ. Macros có thể sử dụng cho hỗ trợ hàm đa tham số."
#: src/control-flow-basics/functions.md #: src/control-flow-basics/functions.md
msgid "" msgid ""
"Always takes a single set of parameter types. These types can be generic, " "Always takes a single set of parameter types. These types can be generic, "
"which will be covered later." "which will be covered later."
msgstr "" msgstr ""
"Luôn luôn chỉ lấy một nhóm kiểu tham số dữ liệu. Những kiểu dữ liệu này có "
"thể là generic (tổng quát), và sẽ được đề cập tới ở phần sau."
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "" msgid ""