15 lines
243 B
Rust
15 lines
243 B
Rust
fn f(i: int, &called: bool) {
|
|
assert i == 10;
|
|
called = true;
|
|
}
|
|
|
|
fn g(f: native fn(int, &bool), &called: bool) {
|
|
f(10, called);
|
|
}
|
|
|
|
fn main() {
|
|
let mut called = false;
|
|
let h = f;
|
|
g(h, called);
|
|
assert called == true;
|
|
} |