rust_add_lib/
lib.rs

1pub fn add_lib(left: usize, right: usize) -> usize {
2    left + right
3}
4
5#[cfg(test)]
6mod tests {
7    use super::*;
8
9    #[test]
10    fn it_works() {
11        let result = add(2, 2);
12        test();
13        assert_eq!(result, 4);
14    }
15}
16
17pub use crate::front_of_house::hosting;
18pub use crate::front_of_house::hosting::add_to_waitlist;
19
20pub fn test() {
21    crate::front_of_house::hosting::add_to_waitlist();
22    front_of_house::hosting::add_to_waitlist()
23}
24
25pub mod front_of_house {
26    pub mod hosting {
27        pub fn add_to_waitlist() {
28            print!("add_to_waitlist");
29        }
30
31        fn seat_at_table() {}
32    }
33
34    mod serving {
35        fn take_order() {}
36
37        fn serve_order() {}
38
39        fn take_payment() {}
40    }
41}