From 4abf853ebed9608583a39b13ab3cd3f14ecd1f4b Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Sun, 27 Sep 2026 10:42:27 -0500 Subject: rustlings: complete 10 --- rustlings/solutions/10_modules/modules1.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'rustlings/solutions/10_modules/modules1.rs') diff --git a/rustlings/solutions/10_modules/modules1.rs b/rustlings/solutions/10_modules/modules1.rs index dcf2377..873b412 100644 --- a/rustlings/solutions/10_modules/modules1.rs +++ b/rustlings/solutions/10_modules/modules1.rs @@ -1,4 +1,15 @@ +mod sausage_factory { + fn get_secret_recipe() -> String { + String::from("Ginger") + } + + // Added `pub` before `fn` to make the function accessible outside the module. + pub fn make_sausage() { + get_secret_recipe(); + println!("sausage!"); + } +} + fn main() { - // DON'T EDIT THIS SOLUTION FILE! - // It will be automatically filled after you finish the exercise. + sausage_factory::make_sausage(); } -- cgit v1.2.3