From f0dae6cfd7f08fbe08499ec97b589db22257ce24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E9=A3=9ESunface?= Date: Sun, 13 Feb 2022 11:01:32 +0800 Subject: [PATCH] Update book/contents/first-try/hello-world.md --- book/contents/first-try/hello-world.md | 1 + 1 file changed, 1 insertion(+) diff --git a/book/contents/first-try/hello-world.md b/book/contents/first-try/hello-world.md index f61892e8..e3e5d5e9 100644 --- a/book/contents/first-try/hello-world.md +++ b/book/contents/first-try/hello-world.md @@ -101,6 +101,7 @@ fn main() { 看完这段代码,不知道你的余音有没有嘎然而止,反正我已经在颤抖了。这就是传说中的下马威嘛?😵 上面代码中,值得注意的 Rust 特性有: + - 控制流:`for` 和 `continue` 连在一起使用,实现循环控制。 - 方法语法:由于 Rust 没有继承,因此 Rust 不是传统意义上的面向对象语言,但是它却从 `OO` 语言那里偷师了方法的使用 `record.trim()`,`record.split(',')` 等。 - 高阶函数编程:函数可以作为参数也能作为返回值,例如 `.map(|field| field.trim())`,这里 `map` 方法中使用闭包函数作为参数,也可以称呼为 `匿名函数`、`lambda 函数`。