rustlings/exercises/02_functions/functions1.rs

16 lines
396 B
Rust
Raw Normal View History

2018-02-22 09:09:53 +03:00
// functions1.rs
//
// Execute `rustlings hint functions1` or use the `hint` watch subcommand for a
// hint.
2015-09-18 04:12:00 +03:00
2015-09-18 04:12:00 +03:00
fn main() {
2024-01-31 18:40:34 +03:00
println!("You define functions outside of main and call them here.");
println!("Call me.");
// Rust doesn't care where the function is defined, as long as it's within the scope.
2015-09-18 04:12:00 +03:00
call_me();
}
2024-01-31 18:40:34 +03:00
fn call_me() {
println!("Beep me. If you wanna reach me.");
}