1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } } ///outer module: this is for testing /// pub mod outer { ///inner module: this is inside outer pub mod inner { ///a simple function /// # Example /// ``` /// outer::inner::simplefunction() /// ``` pub fn simplefunction(){ println!("Simple function!"); } } }