1
0
Fork 0
mirror of https://github.com/notohh/rustlings.git synced 2024-12-22 00:18:09 -05:00
rustlings/exercises/10_modules/modules1.rs

17 lines
366 B
Rust
Raw Normal View History

2024-06-22 07:12:39 -04:00
// 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();
}