From 6e353820beef91a4ae6c2ae4d60c7ee6b3aaaa76 Mon Sep 17 00:00:00 2001 From: David Bailey <davidbailey00@outlook.com> Date: Sat, 16 Jan 2021 20:41:37 +0000 Subject: [PATCH] Add modules solutions --- exercises/modules/modules1.rs | 4 +--- exercises/modules/modules2.rs | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/exercises/modules/modules1.rs b/exercises/modules/modules1.rs index 812dfee..3af7f48 100644 --- a/exercises/modules/modules1.rs +++ b/exercises/modules/modules1.rs @@ -1,10 +1,8 @@ // modules1.rs // Make me compile! Execute `rustlings hint modules1` for hints :) -// I AM NOT DONE - mod sausage_factory { - fn make_sausage() { + pub fn make_sausage() { println!("sausage!"); } } diff --git a/exercises/modules/modules2.rs b/exercises/modules/modules2.rs index fde439d..50a3f08 100644 --- a/exercises/modules/modules2.rs +++ b/exercises/modules/modules2.rs @@ -1,11 +1,9 @@ // modules2.rs // Make me compile! Execute `rustlings hint modules2` for hints :) -// I AM NOT DONE - mod delicious_snacks { - use self::fruits::PEAR as fruit; - use self::veggies::CUCUMBER as veggie; + pub use self::fruits::PEAR as fruit; + pub use self::veggies::CUCUMBER as veggie; mod fruits { pub const PEAR: &'static str = "Pear";