rustlings/exercises/modules/modules1.rs
2021-07-07 21:02:31 +01:00

17 lines
413 B
Rust

// modules1.rs
// Make me compile! Execute `rustlings hint modules1` for hints :)
// `mod` defines a module which can contain functions, structs etc.
// by default, its `fn`s only limited within itself, creating "closed
// ecosystem". you can make them public with `pub`
mod sausage_factory {
pub fn make_sausage() {
println!("sausage!");
}
}
fn main() {
sausage_factory::make_sausage();
}