diff --git a/restaurant/src/back_of_house.rs b/restaurant/src/back_of_house.rs new file mode 100644 index 0000000..e28f98d --- /dev/null +++ b/restaurant/src/back_of_house.rs @@ -0,0 +1,20 @@ +pub struct Breakfast { + pub toast: String, + seasonal_fruit: String, +} + +impl Breakfast { + pub fn summer(toast: &str) -> Breakfast { + Breakfast { + toast: String::from(toast), + seasonal_fruit: String::from("peaches"), + } + } +} + +fn fix_incorrect_order() { + cook_order(); + crate::deliver_order(); +} + +fn cook_order() {} diff --git a/restaurant/src/front_of_house.rs b/restaurant/src/front_of_house.rs new file mode 100644 index 0000000..9b57252 --- /dev/null +++ b/restaurant/src/front_of_house.rs @@ -0,0 +1,3 @@ +pub mod hosting; + +mod serving; diff --git a/restaurant/src/front_of_house/hosting.rs b/restaurant/src/front_of_house/hosting.rs new file mode 100644 index 0000000..e61efc5 --- /dev/null +++ b/restaurant/src/front_of_house/hosting.rs @@ -0,0 +1,3 @@ +pub fn add_to_waitlist() {} + +fn seat_at_table() {} diff --git a/restaurant/src/front_of_house/serving.rs b/restaurant/src/front_of_house/serving.rs new file mode 100644 index 0000000..141d8fd --- /dev/null +++ b/restaurant/src/front_of_house/serving.rs @@ -0,0 +1,5 @@ +fn take_order() {} + +fn serve_order() {} + +fn take_payment() {} diff --git a/restaurant/src/lib.rs b/restaurant/src/lib.rs index 6579106..9bfa793 100644 --- a/restaurant/src/lib.rs +++ b/restaurant/src/lib.rs @@ -1,43 +1,8 @@ fn deliver_order() {} -mod front_of_house { - pub mod hosting { - pub fn add_to_waitlist() {} +mod front_of_house; - fn seat_at_table() {} - } - - mod serving { - fn take_order() {} - - fn serve_order() {} - - fn take_payment() {} - } -} - -mod back_of_house { - pub struct Breakfast { - pub toast: String, - seasonal_fruit: String, - } - - impl Breakfast { - pub fn summer(toast: &str) -> Breakfast { - Breakfast { - toast: String::from(toast), - seasonal_fruit: String::from("peaches"), - } - } - } - - fn fix_incorrect_order() { - cook_order(); - super::deliver_order(); - } - - fn cook_order() {} -} +mod back_of_house; pub fn eat_at_restaurant() { // Order a breakfast in the summer with Rye toast