rustlings

solving rustlings ft. dracuxan
git clone [email protected]:dracuxan/rustlings.git
Log | Files | Refs

modules1.rs (370B)


      1 // TODO: Fix the compiler error about calling a private function.
      2 mod sausage_factory {
      3     // Don't let anybody outside of this module see this!
      4     fn get_secret_recipe() -> String {
      5         String::from("Ginger")
      6     }
      7 
      8     pub fn make_sausage() {
      9         get_secret_recipe();
     10         println!("sausage!");
     11     }
     12 }
     13 
     14 fn main() {
     15     sausage_factory::make_sausage();
     16 }