/// A simple function to be used as a function pointer. fn add(a: i32, b: i32) -> i32 { return a + b; } /// Applies a binary operation to two values. fn apply(op: fn(i32, i32) -> i32, x: i32, y: i32) -> i32 { return op(x, y); } /// Passes a function pointer to another function. fn passPtr(x: i32, y: i32) -> i32 { return apply(add, x, y); }