rustlings/exercises/modules/modules1.rs

20 lines
405 B
Rust
Raw Permalink Normal View History

2018-02-22 00:09:53 -06:00
// modules1.rs
2022-07-14 05:35:49 -05:00
// Execute `rustlings hint modules1` or use the `hint` watch subcommand for a hint.
mod sausage_factory {
// Don't let anybody outside of this module see this!
fn get_secret_recipe() -> String {
String::from("Ginger")
}
2023-04-20 05:50:50 -05:00
pub fn make_sausage() {
get_secret_recipe();
println!("sausage!");
}
}
fn main() {
sausage_factory::make_sausage();
}