Add a demonstration for the super
keyword
This commit is contained in:
parent
ecaa581044
commit
95c1144ca2
1 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
fn deliver_order() {}
|
||||
|
||||
mod front_of_house {
|
||||
pub mod hosting {
|
||||
pub fn add_to_waitlist() {}
|
||||
|
@ -14,6 +16,15 @@ mod front_of_house {
|
|||
}
|
||||
}
|
||||
|
||||
mod back_of_house {
|
||||
fn fix_incorrect_order() {
|
||||
cook_order();
|
||||
super::deliver_order();
|
||||
}
|
||||
|
||||
fn cook_order() {}
|
||||
}
|
||||
|
||||
pub fn eat_at_restaurant() {
|
||||
// Absolute path
|
||||
crate::front_of_house::hosting::add_to_waitlist();
|
||||
|
|
Loading…
Reference in a new issue