box-o-sand/rustbyexample/fn.d/closures.d/anonymity.rs
2023-10-19 11:08:38 -04:00

15 lines
138 B
Rust

fn apply<F>(f: F)
where
F: Fn(),
{
f();
}
fn main() {
let x = 7;
let print = || println!("{}", x);
apply(print);
}