mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-04 01:39:18 +00:00
19 lines
343 B
Rust
19 lines
343 B
Rust
|
|
|
|
|
|
// functions2.rs
|
|
//
|
|
// Execute `rustlings hint functions2` or use the `hint` watch subcommand for a
|
|
// hint.
|
|
|
|
fn main() {
|
|
call_me(3);
|
|
}
|
|
|
|
// NOTE: It is interesting that the function is defined below main but main can still call this.
|
|
fn call_me(num: i32) {
|
|
for i in 0..num {
|
|
println!("Ring! Call number {}", i + 1);
|
|
}
|
|
}
|