Function in the main.rs file
- We already know that we can define functions in the
main.rsfile and call them.
fn main() {
println!("main");
in_main();
}
fn in_main() {
println!("in_main");
}
main
in_main
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
main.rs file and call them.fn main() {
println!("main");
in_main();
}
fn in_main() {
println!("in_main");
}
main
in_main