mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 14:57:32 -05:00
20 lines
406 B
Rust
20 lines
406 B
Rust
// modules1.rs
|
|
//
|
|
// 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")
|
|
}
|
|
|
|
fn make_sausage() {
|
|
get_secret_recipe();
|
|
println!("sausage!");
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
sausage_factory::make_sausage();
|
|
}
|