Typo & Reorder the words

pull/1144/head
Bruce 2 years ago committed by GitHub
parent af1f8cbe72
commit ea2a26f125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -326,7 +326,7 @@ so easy其实跟之前在同一个文件中也没有太大的不同但是
在这里出现了一个新的关键字 `use`,联想到其它章节我们见过的标准库引入 `use std::fmt;`,可以大致猜测,该关键字用来将外部模块中的项引入到当前作用域中来,这样无需冗长的父模块前缀即可调用:`hosting::add_to_waitlist();`,在下节中,我们将对 `use` 进行详细的讲解。
当一个模块子模块也许多的时候,我们也可以通过文件夹的方式来组织我们子模块。
当一个模块有许多子模块的时候,我们也可以通过文件夹的方式来组织我们子模块。
在上述例子中,我们可以创建一个目录 `front_of_house`,然后在文件夹里创建一个 `hosting.rs` 文件,`hosting.rs` 文件现在就剩下:
@ -360,4 +360,4 @@ pub mod hosting;
## 课后练习
> [Rust By Practice](https://zh.practice.rs/crate-module/module.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/crate-module/module.md)。
> [Rust By Practice](https://zh.practice.rs/crate-module/module.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/crate-module/module.md)。

Loading…
Cancel
Save