2018-02-22 09:09:53 +03:00
|
|
|
// functions1.rs
|
2023-05-29 20:39:08 +03:00
|
|
|
//
|
|
|
|
// Execute `rustlings hint functions1` or use the `hint` watch subcommand for a
|
|
|
|
// hint.
|
2015-09-18 04:12:00 +03:00
|
|
|
|
2019-11-11 15:38:24 +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.");
|
|
|
|
}
|