finished ch7.3

This commit is contained in:
2025-01-15 11:58:45 -07:00
parent c6299ee523
commit 4c4dd464dd
4 changed files with 108 additions and 22 deletions

View File

@ -64,3 +64,14 @@ can be called by the relative path ``front_of_house::hosting::add_to_waitlist();
the public API that is determined by the developer is the contract with the users through other crates.
There are many considerations to your public api to make it easier for people to depend on your crate
These details and considerations are more concretely outlined in the [The Rust API Guidelines](https://rust-lang.github.io/api-guidelines/)
## Starting Relative Paths with super
can contract relative paths starting at the parent rather than the root of the crate
This is done by using the ``super`` keyword at the start of the path it is equivalent to the ``..`` syntax
useful for accessing items that we know are in the parent module which can make rearranging the module tree easier when the module is closely related to the parent but may be moved in the future
```rust
super::deliver_order();
```
deliver order now can be located else where in the parent module and not forced to be in the child module