Rust hello world function
-
fn
-
We can declare functions with other names using the
fnkeyword. -
The relative location of the functions does not matter. There is no need to defined headers.
-
We can call the functions by writing their name followed by a pair of parenthesis.
fn main() {
greet();
}
fn greet() {
println!("Hello World!");
}