Pass function as argument - hello world
pass function as a parameter to another function
fn main() {
//hello();
call(hello);
call(world);
}
fn hello() {
println!("Hello");
}
fn world() {
println!("World");
}
fn call(my_function: fn() -> ()) {
my_function();
}
Hello
World