Add module exercises from jdm! 🎉

Fixes #9.
This commit is contained in:
Carol (Nichols || Goulding)
2015-09-17 22:21:56 -04:00
parent 6324eeafe7
commit 9336aed2b9
3 changed files with 96 additions and 0 deletions

42
modules/modules1.rs Normal file
View File

@@ -0,0 +1,42 @@
// Make me compile! Scroll down for hints :)
mod sausage_factory {
fn make_sausage() {
println!("sausage!");
}
}
fn main() {
sausage_factory::make_sausage();
}
// Everything is private in Rust by default-- but there's a keyword we can use
// to make something public! The compiler error should point to the thing that
// needs to be public.