mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-15 06:20:32 +02:00
zh-CN: Day 3 Translations (#1320)
Professional translations for missing day 3 entries #324. This is a new attempt, after fixing the original .po file (#1312). The diff is large mostly because of the normalization. Co-authored-by: Zhang SIQI <zhangsiqi1988@gmail.com>
This commit is contained in:
parent
78dfe60bb3
commit
6949e1b0b8
144
po/zh-CN.po
144
po/zh-CN.po
@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Comprehensive Rust 🦀\n"
|
||||
"POT-Creation-Date: 2023-10-06T12:07:21-07:00\n"
|
||||
"POT-Creation-Date: 2023-10-06T12:25:22-07:00\n"
|
||||
"PO-Revision-Date: 2023-09-11 10:30-0700\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Language zh-Hans\n"
|
||||
@ -7624,6 +7624,7 @@ msgid ""
|
||||
"key-value tuples."
|
||||
msgstr "或者,HashMap 也可以基于任何可生成键-值元组的“Iterator”进行构建。"
|
||||
|
||||
|
||||
#: src/std/hashmap.md:60
|
||||
msgid ""
|
||||
"We are showing `HashMap<String, i32>`, and avoid using `&str` as key to make "
|
||||
@ -8483,37 +8484,37 @@ msgstr ""
|
||||
|
||||
#: src/welcome-day-3.md:1
|
||||
msgid "Welcome to Day 3"
|
||||
msgstr ""
|
||||
msgstr "欢迎参加第 3 天的课程"
|
||||
|
||||
#: src/welcome-day-3.md:3
|
||||
msgid "Today, we will cover some more advanced topics of Rust:"
|
||||
msgstr ""
|
||||
msgstr "今天,我们将介绍一些更高级的 Rust 主题:"
|
||||
|
||||
#: src/welcome-day-3.md:5
|
||||
msgid ""
|
||||
"Traits: deriving traits, default methods, and important standard library "
|
||||
"traits."
|
||||
msgstr ""
|
||||
msgstr "trait:派生 trait、默认方法和重要的标准库 trait。"
|
||||
|
||||
#: src/welcome-day-3.md:8
|
||||
msgid ""
|
||||
"Generics: generic data types, generic methods, monomorphization, and trait "
|
||||
"objects."
|
||||
msgstr ""
|
||||
msgstr "泛型:泛型数据类型、泛型方法、单态化和 trait 对象。"
|
||||
|
||||
#: src/welcome-day-3.md:11
|
||||
msgid "Error handling: panics, `Result`, and the try operator `?`."
|
||||
msgstr ""
|
||||
msgstr "错误处理:panic、“Result”和 try 运算符“?”。"
|
||||
|
||||
#: src/welcome-day-3.md:13
|
||||
msgid "Testing: unit tests, documentation tests, and integration tests."
|
||||
msgstr ""
|
||||
msgstr "测试:单元测试、文档测试和集成测试。"
|
||||
|
||||
#: src/welcome-day-3.md:15
|
||||
msgid ""
|
||||
"Unsafe Rust: raw pointers, static variables, unsafe functions, and extern "
|
||||
"functions."
|
||||
msgstr ""
|
||||
msgstr "不安全 Rust:原始指针、静态变量、不安全函数和外部函数。"
|
||||
|
||||
#: src/generics.md:3
|
||||
#, fuzzy
|
||||
@ -8545,11 +8546,11 @@ msgstr ""
|
||||
|
||||
#: src/generics/data-types.md:21
|
||||
msgid "Try declaring a new variable `let p = Point { x: 5, y: 10.0 };`."
|
||||
msgstr ""
|
||||
msgstr "尝试声明一个新变量“let p = Point { x: 5, y: 10.0 };”。"
|
||||
|
||||
#: src/generics/data-types.md:23
|
||||
msgid "Fix the code to allow points that have elements of different types."
|
||||
msgstr ""
|
||||
msgstr "修正代码,以允许点具有不同类型的元素。"
|
||||
|
||||
#: src/generics/methods.md:3
|
||||
msgid "You can declare a generic type on your `impl` block:"
|
||||
@ -8768,7 +8769,7 @@ msgstr ""
|
||||
msgid ""
|
||||
"`dyn Pet` is a way to tell the compiler about a dynamically sized type that "
|
||||
"implements `Pet`."
|
||||
msgstr ""
|
||||
msgstr "可通过“dyn Pet”这个方法向编译器告知实现“Pet”的动态大小类型。"
|
||||
|
||||
#: src/traits/trait-objects.md:72
|
||||
msgid ""
|
||||
@ -8792,7 +8793,7 @@ msgstr ""
|
||||
|
||||
#: src/traits/trait-objects.md:79
|
||||
msgid "Compare these outputs in the above example:"
|
||||
msgstr ""
|
||||
msgstr "比较上述示例中的这些输出:"
|
||||
|
||||
#: src/traits/trait-objects.md:80
|
||||
msgid ""
|
||||
@ -8810,7 +8811,7 @@ msgstr ""
|
||||
msgid ""
|
||||
"Rust derive macros work by automatically generating code that implements the "
|
||||
"specified traits for a data structure."
|
||||
msgstr ""
|
||||
msgstr "Rust 派生宏的运作方式是自动生成代码,用于实现数据结构的指定 trait。"
|
||||
|
||||
#: src/traits/deriving-traits.md:5
|
||||
#, fuzzy
|
||||
@ -8875,25 +8876,25 @@ msgid ""
|
||||
"Traits may specify pre-implemented (default) methods and methods that users "
|
||||
"are required to implement themselves. Methods with default implementations "
|
||||
"can rely on required methods."
|
||||
msgstr ""
|
||||
msgstr "trait 或许可指定预实现(默认)方法,以及用户需要自行实现的方法。具有默认实现的方法可以依赖于必需的方法。"
|
||||
|
||||
#: src/traits/default-methods.md:35
|
||||
msgid "Move method `not_equals` to a new trait `NotEquals`."
|
||||
msgstr ""
|
||||
msgstr "将方法“not_equals”移至新的 trait“NotEquals”。"
|
||||
|
||||
#: src/traits/default-methods.md:37
|
||||
msgid "Make `Equals` a super trait for `NotEquals`."
|
||||
msgstr ""
|
||||
msgstr "将“Equals”设为“NotEquals”的超 trait。"
|
||||
|
||||
#: src/traits/default-methods.md:46
|
||||
msgid "Provide a blanket implementation of `NotEquals` for `Equals`."
|
||||
msgstr ""
|
||||
msgstr "为“Equals”提供“NotEquals”的通用实现。"
|
||||
|
||||
#: src/traits/default-methods.md:58
|
||||
msgid ""
|
||||
"With the blanket implementation, you no longer need `Equals` as a super "
|
||||
"trait for `NotEqual`."
|
||||
msgstr ""
|
||||
msgstr "借助通用实现,您不再需要将“Equals”作为“NotEqual”的超 trait。"
|
||||
|
||||
#: src/traits/trait-bounds.md:3
|
||||
msgid ""
|
||||
@ -9511,6 +9512,7 @@ msgid ""
|
||||
"the `..` syntax is called [struct update "
|
||||
"syntax](https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax)"
|
||||
msgstr ""
|
||||
"“..”语法被称为[结构体更新语法](https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax)"
|
||||
|
||||
#: src/traits/operators.md:1
|
||||
msgid "`Add`, `Mul`, ..."
|
||||
@ -9679,17 +9681,17 @@ msgstr ""
|
||||
|
||||
#: src/exercises/day-3/morning.md:1
|
||||
msgid "Day 3: Morning Exercises"
|
||||
msgstr ""
|
||||
msgstr "第 3 天:上午练习"
|
||||
|
||||
#: src/exercises/day-3/morning.md:3
|
||||
msgid "We will design a classical GUI library using traits and trait objects."
|
||||
msgstr ""
|
||||
msgstr "我们将使用 trait 和 trait 对象设计一个经典的 GUI 库。"
|
||||
|
||||
#: src/exercises/day-3/morning.md:5
|
||||
msgid ""
|
||||
"We will also look at enum dispatch with an exercise involving points and "
|
||||
"polygons."
|
||||
msgstr ""
|
||||
msgstr "我们还将通过点和多边形的相关练习,探讨枚举调度情况。"
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:1
|
||||
#: src/exercises/day-3/solutions-morning.md:3
|
||||
@ -9706,11 +9708,11 @@ msgstr ""
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:6
|
||||
msgid "We will have a number of widgets in our library:"
|
||||
msgstr ""
|
||||
msgstr "我们的库中有许多 widget:"
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:8
|
||||
msgid "`Window`: has a `title` and contains other widgets."
|
||||
msgstr ""
|
||||
msgstr "“Window”:具有“title”且包含其他 widget。"
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:9
|
||||
msgid ""
|
||||
@ -9721,17 +9723,19 @@ msgstr ""
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:12
|
||||
msgid "`Label`: has a `label`."
|
||||
msgstr ""
|
||||
msgstr "“Label”:具有“label”。"
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:14
|
||||
msgid "The widgets will implement a `Widget` trait, see below."
|
||||
msgstr ""
|
||||
msgstr "这些 widget 将实现“Widget”trait,如下所示。"
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:16
|
||||
msgid ""
|
||||
"Copy the code below to <https://play.rust-lang.org/>, fill in the missing "
|
||||
"`draw_into` methods so that you implement the `Widget` trait:"
|
||||
msgstr ""
|
||||
"将以下代码复制到 "
|
||||
"<https://play.rust-lang.org/>,然后填入缺少的“draw_into”方法,以便实现“Widget”trait:"
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:19
|
||||
msgid ""
|
||||
@ -9848,7 +9852,7 @@ msgstr ""
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:128
|
||||
msgid "The output of the above program can be something simple like this:"
|
||||
msgstr ""
|
||||
msgstr "上述程序的输出可能非常简单,例如:"
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:140
|
||||
msgid ""
|
||||
@ -9857,6 +9861,7 @@ msgid ""
|
||||
"formatting operators. In particular, notice how you can pad with different "
|
||||
"characters (here a `'/'`) and how you can control alignment:"
|
||||
msgstr ""
|
||||
"如果要绘制对齐的文本,可以使用[填充/对齐](https://doc.rust-lang.org/std/fmt/index.html#fillalignment)格式设置运算符。需要特别注意的是您填充不同字符(此处是“/”)的方式以及控制对齐的方式:"
|
||||
|
||||
#: src/exercises/day-3/simple-gui.md:145
|
||||
msgid ""
|
||||
@ -9873,11 +9878,11 @@ msgstr ""
|
||||
#: src/exercises/day-3/simple-gui.md:154
|
||||
msgid ""
|
||||
"Using such alignment tricks, you can for example produce output like this:"
|
||||
msgstr ""
|
||||
msgstr "使用这些对齐技巧,您可以生成如下的输出内容:"
|
||||
|
||||
#: src/exercises/day-3/points-polygons.md:1
|
||||
msgid "Polygon Struct"
|
||||
msgstr ""
|
||||
msgstr "多边形结构体"
|
||||
|
||||
#: src/exercises/day-3/points-polygons.md:3
|
||||
msgid ""
|
||||
@ -9885,6 +9890,8 @@ msgid ""
|
||||
"below to <https://play.rust-lang.org/> and fill in the missing methods to "
|
||||
"make the tests pass:"
|
||||
msgstr ""
|
||||
"我们将创建一个包含一些点的“Polygon”结构体。将以下代码复制到 "
|
||||
"<https://play.rust-lang.org/>,然后填入缺少的方法,设法通过测试:"
|
||||
|
||||
#: src/exercises/day-3/points-polygons.md:7
|
||||
msgid ""
|
||||
@ -10002,23 +10009,23 @@ msgid ""
|
||||
"Since the method signatures are missing from the problem statements, the key "
|
||||
"part of the exercise is to specify those correctly. You don't have to modify "
|
||||
"the tests."
|
||||
msgstr ""
|
||||
msgstr "由于问题语句中缺少方法签名,因此练习的关键部分是正确指定这些内容。您无需修改测试。"
|
||||
|
||||
#: src/exercises/day-3/points-polygons.md:120
|
||||
msgid "Other interesting parts of the exercise:"
|
||||
msgstr ""
|
||||
msgstr "练习的其他有趣部分:"
|
||||
|
||||
#: src/exercises/day-3/points-polygons.md:122
|
||||
msgid ""
|
||||
"Derive a `Copy` trait for some structs, as in tests the methods sometimes "
|
||||
"don't borrow their arguments."
|
||||
msgstr ""
|
||||
msgstr "为某些结构体派生“Copy”trait,因为在测试中,方法有时不借用它们的参数。"
|
||||
|
||||
#: src/exercises/day-3/points-polygons.md:123
|
||||
msgid ""
|
||||
"Discover that `Add` trait must be implemented for two objects to be addable "
|
||||
"via \"+\". Note that we do not discuss generics until Day 3."
|
||||
msgstr ""
|
||||
msgstr "发现必须实现“Add”trait 才能通过“+”添加两个对象。请注意,我们在第 3 天之前不会讨论泛型。"
|
||||
|
||||
#: src/error-handling.md:3
|
||||
msgid "Error handling in Rust is done using explicit control flow:"
|
||||
@ -10207,6 +10214,7 @@ msgid ""
|
||||
msgstr "可以使用 `fs::write` 调用来测试不同的场景:没有文件、空文件、包含用户名的文件。"
|
||||
|
||||
#: src/error-handling/try-operator.md:52
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"The return type of the function has to be compatible with the nested "
|
||||
"functions it calls. For instance, a function returning a `Result<T, Err>` "
|
||||
@ -10216,6 +10224,16 @@ msgid ""
|
||||
"`From<Err>`. Reciprocally, a function returning an `Option<T>` can only "
|
||||
"apply the `?` operator on a function returning an `Option<AnyT>`."
|
||||
msgstr ""
|
||||
"函数的返回值类型必须与其调用的嵌套函数兼容。例如,一个返回“Result\\<T, Err>”的函数只能对返回“Result\\<AnyT, "
|
||||
"Err>”的函数应用“?”运算符。它无法对返回“Option\n"
|
||||
"\n"
|
||||
"”或“Result\\<T, OtherErr>”的函数应用“?”运算符,除非“OtherErr”实现“From\n"
|
||||
"\n"
|
||||
"”。相反地,返回“Option\n"
|
||||
"\n"
|
||||
"”的函数只能对返回“Option\n"
|
||||
"\n"
|
||||
"”的函数应用“?”运算符。"
|
||||
|
||||
#: src/error-handling/try-operator.md:57
|
||||
msgid ""
|
||||
@ -10223,6 +10241,7 @@ msgid ""
|
||||
"`Option` and `Result` methods such as `Option::ok_or`, `Result::ok`, "
|
||||
"`Result::err`."
|
||||
msgstr ""
|
||||
"您可以使用其他“Option”和“Result”方法(例如“Option::ok_or”“Result::ok”“Result::err”)将不兼容的类型转换为另一种类型。"
|
||||
|
||||
#: src/error-handling/converting-error-types.md:3
|
||||
msgid ""
|
||||
@ -10297,6 +10316,9 @@ msgid ""
|
||||
"[nightly](https://github.com/rust-lang/rust/issues/103765), so not fully "
|
||||
"`no_std` compatible yet."
|
||||
msgstr ""
|
||||
"对所有不需要是“no_std”的错误类型来说,实现“std::error::Error”是一种很好的做法,而这需要“Debug”和“Display”。“core”的“Error”crate "
|
||||
"仅在 [nightly](https://github.com/rust-lang/rust/issues/103765) "
|
||||
"提供,因此尚未与“no_std”完全兼容。"
|
||||
|
||||
#: src/error-handling/converting-error-types-example.md:57
|
||||
#, fuzzy
|
||||
@ -11002,6 +11024,8 @@ msgid ""
|
||||
"The `\"C\"` in this example is the ABI; [other ABIs are available "
|
||||
"too](https://doc.rust-lang.org/reference/items/external-blocks.html)."
|
||||
msgstr ""
|
||||
"本例中的“C”是 ABI;[也可以使用其他 "
|
||||
"ABI](https://doc.rust-lang.org/reference/items/external-blocks.html)。"
|
||||
|
||||
#: src/unsafe/unsafe-traits.md:3
|
||||
msgid ""
|
||||
@ -11058,29 +11082,29 @@ msgstr "内置的 `Send` 和 `Sync` trait 都是不安全的。"
|
||||
|
||||
#: src/exercises/day-3/afternoon.md:1
|
||||
msgid "Day 3: Afternoon Exercises"
|
||||
msgstr ""
|
||||
msgstr "第 3 天:下午练习"
|
||||
|
||||
#: src/exercises/day-3/afternoon.md:3
|
||||
msgid "Let us build a safe wrapper for reading directory content!"
|
||||
msgstr ""
|
||||
msgstr "让我们构建一个用于读取目录内容的安全封装容器!"
|
||||
|
||||
#: src/exercises/day-3/afternoon.md:5
|
||||
msgid ""
|
||||
"For this exercise, we suggest using a local dev environment instead of the "
|
||||
"Playground. This will allow you to run your binary on your own machine."
|
||||
msgstr ""
|
||||
msgstr "在本练习中,我们建议您使用本地开发环境,而不是 Playground。这样,您就可以在自己的机器上运行二进制文件。"
|
||||
|
||||
#: src/exercises/day-3/afternoon.md:8
|
||||
msgid ""
|
||||
"To get started, follow the [running locally](../../cargo/running-locally.md) "
|
||||
"instructions."
|
||||
msgstr ""
|
||||
msgstr "首先,请按照[在本地运行](../../cargo/running-locally.md)中的说明操作。"
|
||||
|
||||
#: src/exercises/day-3/afternoon.md:14
|
||||
msgid ""
|
||||
"After looking at the exercise, you can look at the "
|
||||
"[solution](solutions-afternoon.md) provided."
|
||||
msgstr ""
|
||||
msgstr "看过练习后,您可以查看所提供的[解题方法](solutions-afternoon.md)。"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:3
|
||||
msgid ""
|
||||
@ -11091,19 +11115,19 @@ msgstr ""
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:7
|
||||
msgid "You will want to consult the manual pages:"
|
||||
msgstr ""
|
||||
msgstr "建议您参考以下手册页面:"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:9
|
||||
msgid "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)"
|
||||
msgstr ""
|
||||
msgstr "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:10
|
||||
msgid "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)"
|
||||
msgstr ""
|
||||
msgstr "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:11
|
||||
msgid "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)"
|
||||
msgstr ""
|
||||
msgstr "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:13
|
||||
msgid ""
|
||||
@ -11111,82 +11135,86 @@ msgid ""
|
||||
"[`std::ffi`](https://doc.rust-lang.org/std/ffi/) module. There you find a "
|
||||
"number of string types which you need for the exercise:"
|
||||
msgstr ""
|
||||
"您还需要浏览[“std::ffi”](https://doc.rust-lang.org/std/ffi/)模块。在下方,您会发现完成这个练习所需的多种字符串类型:"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:16
|
||||
msgid "Encoding"
|
||||
msgstr ""
|
||||
msgstr "编码"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:16
|
||||
msgid "Use"
|
||||
msgstr ""
|
||||
msgstr "使用"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
||||
msgid ""
|
||||
"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and "
|
||||
"[`String`](https://doc.rust-lang.org/std/string/struct.String.html)"
|
||||
msgstr ""
|
||||
"[“str”](https://doc.rust-lang.org/std/primitive.str.html)和[“String”](https://doc.rust-lang.org/std/string/struct.String.html)"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
||||
msgid "UTF-8"
|
||||
msgstr ""
|
||||
msgstr "UTF-8"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
||||
msgid "Text processing in Rust"
|
||||
msgstr ""
|
||||
msgstr "用 Rust 进行文本处理"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
||||
msgid ""
|
||||
"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and "
|
||||
"[`CString`](https://doc.rust-lang.org/std/ffi/struct.CString.html)"
|
||||
msgstr ""
|
||||
"[“CStr”](https://doc.rust-lang.org/std/ffi/struct.CStr.html)和[“CString”](https://doc.rust-lang.org/std/ffi/struct.CString.html)"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
||||
msgid "NUL-terminated"
|
||||
msgstr ""
|
||||
msgstr "以空字符结尾"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
||||
msgid "Communicating with C functions"
|
||||
msgstr ""
|
||||
msgstr "与 C 函数通信"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
||||
msgid ""
|
||||
"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and "
|
||||
"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)"
|
||||
msgstr ""
|
||||
"[“OsStr”](https://doc.rust-lang.org/std/ffi/struct.OsStr.html)和[“OsString”](https://doc.rust-lang.org/std/ffi/struct.OsString.html)"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
||||
msgid "OS-specific"
|
||||
msgstr ""
|
||||
msgstr "特定于操作系统"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
||||
msgid "Communicating with the OS"
|
||||
msgstr ""
|
||||
msgstr "与操作系统通信"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:22
|
||||
msgid "You will convert between all these types:"
|
||||
msgstr ""
|
||||
msgstr "您将在以下所有类型之间进行转换:"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:24
|
||||
msgid ""
|
||||
"`&str` to `CString`: you need to allocate space for a trailing `\\0` "
|
||||
"character,"
|
||||
msgstr ""
|
||||
msgstr "将“&str”转换为“CString”:您需要为尾随“\\0”字符分配空格,"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:25
|
||||
msgid "`CString` to `*const i8`: you need a pointer to call C functions,"
|
||||
msgstr ""
|
||||
msgstr "将“CString”转换为“\\*const i8”:您需要一个指针来调用 C 函数,"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:26
|
||||
msgid ""
|
||||
"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` "
|
||||
"character,"
|
||||
msgstr ""
|
||||
msgstr "将“\\*const i8”转换为“&CStr”:您需要一些能够找到尾随“\\0”字符的内容,"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:27
|
||||
msgid ""
|
||||
"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some "
|
||||
"unknow data\","
|
||||
msgstr ""
|
||||
msgstr "将“&CStr”转换为“&\\[u8\\]”:一个字节 Slice 是“一些未知数据”的通用接口,"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:28
|
||||
msgid ""
|
||||
@ -11194,24 +11222,25 @@ msgid ""
|
||||
"[`OsStrExt`](https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) "
|
||||
"to create it,"
|
||||
msgstr ""
|
||||
"将“&\\[u8\\]”转换为“&OsStr”:“&OsStr”是向“OsString”迈进的一步,请使用[“OsStrExt”](https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html)来创建它,"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:31
|
||||
msgid ""
|
||||
"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to "
|
||||
"return it and call `readdir` again."
|
||||
msgstr ""
|
||||
msgstr "将“&OsStr”转换为“OsString”:您需要克隆“&OsStr”中的数据,以便能够返回它并再次调用“readdir”。"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:34
|
||||
msgid ""
|
||||
"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very "
|
||||
"useful chapter about FFI."
|
||||
msgstr ""
|
||||
msgstr "[秘典](https://doc.rust-lang.org/nomicon/ffi.html) 中也有一个关于 FFI 的非常实用的章节。"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:45
|
||||
msgid ""
|
||||
"Copy the code below to <https://play.rust-lang.org/> and fill in the missing "
|
||||
"functions and methods:"
|
||||
msgstr ""
|
||||
msgstr "将以下代码复制到 <https://play.rust-lang.org/>,并填入缺少的函数和方法:"
|
||||
|
||||
#: src/exercises/day-3/safe-ffi-wrapper.md:48
|
||||
msgid ""
|
||||
@ -19167,7 +19196,6 @@ msgid "unit test:"
|
||||
msgstr "单元测试"
|
||||
|
||||
#: src/glossary.md:103
|
||||
#, fuzzy
|
||||
msgid "unsafe:"
|
||||
msgstr "是(不安全)"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user