Initial commit
This commit is contained in:
16
exercises/10_modules/modules1.rs
Normal file
16
exercises/10_modules/modules1.rs
Normal file
@@ -0,0 +1,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")
|
||||
}
|
||||
|
||||
pub fn make_sausage() {
|
||||
get_secret_recipe();
|
||||
println!("sausage!");
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
sausage_factory::make_sausage();
|
||||
}
|
||||
Reference in New Issue
Block a user