complete: modules

This commit is contained in:
seth 2021-06-21 16:33:00 +08:00
parent 2c461ef23a
commit 49a36bc041
2 changed files with 3 additions and 7 deletions
exercises/modules

View file

@ -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!");
}
}

View file

@ -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";