Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub fn foo() {}
pub mod restaurant;
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use rust_template::restaurant;

fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Welcome at {}", restaurant::display_name());
restaurant::foh::process_visit();
Ok(())
}
9 changes: 9 additions & 0 deletions src/restaurant/boh/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pub fn fix_incorrect_order() {
println!("Fix incorrect order:");
cook_order();
super::deliver_order();
}

pub fn cook_order() {
println!("Cook order");
}
9 changes: 9 additions & 0 deletions src/restaurant/foh/hosting/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pub fn add_to_wait_list() {
println!("Add to wait list");
}

pub fn seat_at_table() {
println!("Seat at table");
}

pub fn welcome() {}
14 changes: 14 additions & 0 deletions src/restaurant/foh/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pub mod hosting;
pub mod serving;

pub fn process_visit() {
hosting::welcome();
hosting::add_to_wait_list();
hosting::seat_at_table();
serving::take_order();
serving::serve_order();
super::boh::cook_order();
serving::take_complaint();
super::boh::fix_incorrect_order();
serving::take_payment();
}
17 changes: 17 additions & 0 deletions src/restaurant/foh/serving/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use crate::restaurant;

pub fn take_order() {
println!("Take order");
}

pub fn serve_order() {
println!("Serve order");
}

pub fn take_payment() {
println!("Thanks for your visit at {}", restaurant::display_name());
}

pub fn take_complaint() {
println!("Take complaint");
}
10 changes: 10 additions & 0 deletions src/restaurant/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pub fn display_name() -> &'static str {
"Greek restaurant"
}

fn deliver_order() {
println!("Deliver order");
}

pub mod boh;
pub mod foh;
Loading