summaryrefslogtreecommitdiff
path: root/exercises/10_modules/modules1.rs
blob: d97ab23a53023a5d82e9f1ffdbe58e7d779c7e15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// TODO: Fix the compiler error about calling a private function.
mod sausage_factory {
    // Don't let anybody outside of this module see this!
    fn get_secret_recipe() -> String {
        String::from("Ginger")
    }

    fn make_sausage() {
        get_secret_recipe();
        println!("sausage!");
    }
}

fn main() {
    sausage_factory::make_sausage();
}