rustlings/exercises/10_modules/modules1.rs
Denis-Cosmin NUTIU 06573e87ac initial commit
2024-10-28 22:46:17 +02:00

16 lines
364 B
Rust

// 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")
}
pub fn make_sausage() {
get_secret_recipe();
println!("sausage!");
}
}
fn main() {
sausage_factory::make_sausage();
}