From f30c5ef1f26ebfddbc61fc011973614188113d6a Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Mon, 25 Nov 2019 17:38:19 +0100 Subject: [PATCH] Organize modules in new source files --- restaurant/src/front_of_house.rs | 27 ++++++++++++++++++++++++ restaurant/src/front_of_house/hosting.rs | 23 ++++++++++++++++++++ restaurant/src/lib.rs | 13 +----------- 3 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 restaurant/src/front_of_house.rs create mode 100644 restaurant/src/front_of_house/hosting.rs diff --git a/restaurant/src/front_of_house.rs b/restaurant/src/front_of_house.rs new file mode 100644 index 0000000..eda2337 --- /dev/null +++ b/restaurant/src/front_of_house.rs @@ -0,0 +1,27 @@ +// +// Move some restaurant stuff in a different file.... +// +// Georg Hopp +// +// Copyright © 2019 Georg Hopp +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +pub mod hosting; + +mod serving { + fn take_order() {} + fn take_payment() {} +} diff --git a/restaurant/src/front_of_house/hosting.rs b/restaurant/src/front_of_house/hosting.rs new file mode 100644 index 0000000..00637f8 --- /dev/null +++ b/restaurant/src/front_of_house/hosting.rs @@ -0,0 +1,23 @@ +// +// Now also sepatate hosting.... +// +// Georg Hopp +// +// Copyright © 2019 Georg Hopp +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +pub fn add_to_waitlist() {} +fn seat_at_table() {} diff --git a/restaurant/src/lib.rs b/restaurant/src/lib.rs index 94db963..d9bc3a7 100644 --- a/restaurant/src/lib.rs +++ b/restaurant/src/lib.rs @@ -19,18 +19,7 @@ // along with this program. If not, see . // -mod front_of_house { - pub mod hosting { - pub fn add_to_waitlist() {} - fn seat_at_table() {} - } - - mod serving { - fn take_order() {} - fn take_payment() {} - - } -} +mod front_of_house; fn serve_order() {}