Function in the main.rs file
- We already know that we can define functions in the main.rs file and call them.
examples/modules/function-in-main/src/main.rs
fn main() { println!("main"); in_main(); } fn in_main() { println!("in_main"); }
main in_main