Add a demonstration for the super keyword

This commit is contained in:
Manuel Thalmann 2025-01-16 16:30:03 +01:00
parent ecaa581044
commit 95c1144ca2

View file

@ -1,3 +1,5 @@
fn deliver_order() {}
mod front_of_house { mod front_of_house {
pub mod hosting { pub mod hosting {
pub fn add_to_waitlist() {} 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() { pub fn eat_at_restaurant() {
// Absolute path // Absolute path
crate::front_of_house::hosting::add_to_waitlist(); crate::front_of_house::hosting::add_to_waitlist();