Updated 'src/packages_crates_and_modules/the_use_keyword.md'.

This commit is contained in:
Hector PENG 2024-10-07 18:12:55 +08:00
parent a2f1181c1c
commit 4750e1292d

View File

@ -167,7 +167,7 @@ error: could not compile `restaurant` due to 2 previous errors
我们还可以在 `add_too_waitlist` 函数的定义前,添加 `pub` 关键字,使其成为公共函数,如清单 7-7 所示。 我们还可以在 `add_too_waitlist` 函数的定义前,添加 `pub` 关键字,使其成为公共函数,如清单 7-7 所示。
<a name="list_7-7"></a>
文件名:`src/lib.rs` 文件名:`src/lib.rs`
```rust ```rust
@ -186,7 +186,7 @@ pub fn eat_at_restaurant() {
} }
``` ```
*<a name="list_7-7">清单 7-7</a>:在 `mod hosting``fn add_too_waitlist` 中添加 `pub` 关键字后,我们就可以在 `eat_at_restaurant` 中调用了这个函数* *清单 7-7`mod hosting``fn add_too_waitlist` 中添加 `pub` 关键字后,我们就可以在 `eat_at_restaurant` 中调用了这个函数*
现在代码可以编译了!要了解为何添加 `pub` 关键字后,我们就可以在 `add_too_waitlist` 中,在遵守隐私规则下使用这些路径,我们来看看其中的绝对路径和相对路径。 现在代码可以编译了!要了解为何添加 `pub` 关键字后,我们就可以在 `add_too_waitlist` 中,在遵守隐私规则下使用这些路径,我们来看看其中的绝对路径和相对路径。