mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-23 23:19:20 +02:00
zh-Hans: Translation for src/why-rust/modern.md (#744)
* zh-Hans: Translation for src/why-rust/modern.md * remove redundant space * Apply suggestions from code review Co-authored-by: wnghl <wnghilin@gmail.com> --------- Co-authored-by: wnghl <wnghilin@gmail.com>
This commit is contained in:
parent
6e16928ee3
commit
323114c969
42
po/zh-CN.po
42
po/zh-CN.po
@ -82,7 +82,7 @@ msgstr ""
|
||||
|
||||
#: src/SUMMARY.md:25
|
||||
msgid "Modern Features"
|
||||
msgstr ""
|
||||
msgstr "现代特性"
|
||||
|
||||
#: src/SUMMARY.md:26
|
||||
msgid "Basic Syntax"
|
||||
@ -2319,15 +2319,15 @@ msgstr ""
|
||||
|
||||
#: src/why-rust/modern.md:1
|
||||
msgid "# Modern Features"
|
||||
msgstr ""
|
||||
msgstr "# 现代特性"
|
||||
|
||||
#: src/why-rust/modern.md:3
|
||||
msgid "Rust is built with all the experience gained in the last 40 years."
|
||||
msgstr ""
|
||||
msgstr "Rust 建立于过去 40 年来所获得的经验之上。"
|
||||
|
||||
#: src/why-rust/modern.md:5
|
||||
msgid "## Language Features"
|
||||
msgstr ""
|
||||
msgstr "## 语言特性"
|
||||
|
||||
#: src/why-rust/modern.md:7
|
||||
msgid ""
|
||||
@ -2336,10 +2336,14 @@ msgid ""
|
||||
"* No overhead FFI.\n"
|
||||
"* Zero-cost abstractions."
|
||||
msgstr ""
|
||||
"* 枚举和模式匹配。\n"
|
||||
"* 泛型。\n"
|
||||
"* 无额外开销外部函数接口(FFI)。\n"
|
||||
"* 零成本抽象。"
|
||||
|
||||
#: src/why-rust/modern.md:12
|
||||
msgid "## Tooling"
|
||||
msgstr ""
|
||||
msgstr "## 工具"
|
||||
|
||||
#: src/why-rust/modern.md:14
|
||||
msgid ""
|
||||
@ -2348,6 +2352,10 @@ msgid ""
|
||||
"* Built-in support for testing.\n"
|
||||
"* Excellent Language Server Protocol support."
|
||||
msgstr ""
|
||||
"* 强大的编译器错误提示。\n"
|
||||
"* 内置依赖管理器。\n"
|
||||
"* 对测试的内置支持。\n"
|
||||
"* 优秀的语言服务协议(Language Server Protocol)支持。"
|
||||
|
||||
#: src/why-rust/modern.md:23
|
||||
msgid ""
|
||||
@ -2399,6 +2407,30 @@ msgid ""
|
||||
"* [rust-analyzer] is a well supported LSP implementation used in major\n"
|
||||
" IDEs and text editors."
|
||||
msgstr ""
|
||||
"* 与 C++ 类似的零成本抽象,意味着你不需要为高级程序语言的结构“付出”更多的内存和 CPU。"
|
||||
"例如使用 `for` 循环与使用 `.iter().fold()` 结构应该会生成大致相同的底层指令。\n"
|
||||
"\n"
|
||||
"* 值得一提的是,Rust 的枚举是“代数数据类型”(也叫“和类型”)。它使得类型系统可以表示\n"
|
||||
" `Option<T>` 和 `Result<T, E>` 等结构。\n"
|
||||
"\n"
|
||||
"* 提醒学生去阅读编译错误 --- 许多开发者已经习惯去忽略冗长的编译器输出。Rust 编译器会比其它编译器更健谈。"
|
||||
"它通常会提供 _可操作的_ 反馈,可以直接复制粘贴到代码中。\n"
|
||||
"\n"
|
||||
"* 相比 Java, Python 和 Go 等语言,Rust 标准库较为精简。Rust 并没有内置一些你可能认为标准和必要的功能:\n"
|
||||
"\n"
|
||||
" * 随机数生成器,可以使用 [rand] 替代。\n"
|
||||
" * SSL 和 TLS 支持,可以使用 [rusttls] 替代。\n"
|
||||
" * JSON 支持,可以使用 [serde_json] 替代。\n"
|
||||
"\n"
|
||||
" Rust 这么做的原因是标准库中的功能是无法去除的,因此该功能必须非常稳定。"
|
||||
"对于以上例子,Rust 社区仍在寻找最佳解决方案 --- 甚至对一些情况可能没有单一的“最佳解决方案”。\n"
|
||||
"\n"
|
||||
" Rust 内置了一个包管理器 Cargo,使得下载和编译第三方 crate 变得简单。这也导致标准库可以更加精简。\n"
|
||||
"\n"
|
||||
" 发现高质量的第三方 crate 也许是一个问题。\n"
|
||||
" <https://lib.rs/> 等网站对此问题有所帮助。它能帮你比较 crate 的健康指标,以找到一个高质量并受信任的 crate。\n"
|
||||
" \n"
|
||||
"* [rust-analyzer] 是一个受到广泛支持的 LSP 实现,被主流的 IDE 和文本编辑器所使用。"
|
||||
|
||||
#: src/basic-syntax.md:1
|
||||
msgid "# Basic Syntax"
|
||||
|
Loading…
x
Reference in New Issue
Block a user