mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-22 20:19:42 +00:00
Merge pull request #543 from nativemen/optimize
Fix minor issues to meet the requirements of the question and recommend using the modules provided by the library crate.
This commit is contained in:
@ -83,8 +83,9 @@ mod back_of_house {
|
||||
```rust
|
||||
// in src/lib.rs
|
||||
|
||||
mod front_of_house;
|
||||
mod back_of_house;
|
||||
pub mod front_of_house;
|
||||
pub mod back_of_house;
|
||||
|
||||
pub fn eat_at_restaurant() -> String {
|
||||
front_of_house::hosting::add_to_waitlist();
|
||||
|
||||
@ -140,10 +141,8 @@ fn complain() {}
|
||||
5.
|
||||
|
||||
```rust
|
||||
mod front_of_house;
|
||||
|
||||
fn main() {
|
||||
assert_eq!(front_of_house::hosting::seat_at_table(), "sit down please");
|
||||
assert_eq!(hello_package::eat_at_restaurant(),"yummy yummy!");
|
||||
assert_eq!(hello_package::front_of_house::hosting::seat_at_table(), "sit down please");
|
||||
assert_eq!(hello_package::eat_at_restaurant(), "yummy yummy!");
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user