Rust learning: lessons, notes, and exercise crates
This commit is contained in:
@@ -0,0 +1 @@
|
||||
/target
|
||||
Generated
+7
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "restauran"
|
||||
version = "0.1.0"
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "restauran"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1 @@
|
||||
pub mod hosting;
|
||||
@@ -0,0 +1 @@
|
||||
pub fn add_to_waitlist() {}
|
||||
@@ -0,0 +1,31 @@
|
||||
mod front_of_house;
|
||||
// {
|
||||
// pub mod hosting {
|
||||
// pub fn add_to_waitlist() {}
|
||||
//
|
||||
// fn seat_at_table() {}
|
||||
// }
|
||||
//
|
||||
// mod serving {
|
||||
// fn take_order() {}
|
||||
// fn serve_order() {}
|
||||
// fn take_payment() {}
|
||||
// }
|
||||
// }
|
||||
|
||||
pub fn eat_at_restaurant() {
|
||||
let arr: [u16; 10] = [0; 10];
|
||||
// Absolute path
|
||||
crate::front_of_house::hosting::add_to_waitlist();
|
||||
|
||||
// Relative path
|
||||
front_of_house::hosting::add_to_waitlist();
|
||||
}
|
||||
|
||||
use crate::front_of_house::hosting;
|
||||
|
||||
mod customer {
|
||||
pub fn eat_at_restaurant() {
|
||||
super::hosting::add_to_waitlist();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user