15 lines
138 B
Rust
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);
|
||
|
}
|