modules.rs (332B)
1 // To create this modtest module, make a file modtest.rs or a modtest/mod.rs 2 mod modtest; 3 4 // Define module in block 5 mod here_mod { 6 pub fn funcy(s: &str) { 7 println!("{}", s) 8 } 9 } 10 11 fn main() { 12 here_mod::funcy("Will print"); 13 modtest::external(); 14 let s = modtest::nested::nestfunc(); 15 println!("{}", s) 16 }