You can pass closures to functions
(a: i32, b: i32, func: T)
| 859 | |
| 860 | // You can pass closures to functions |
| 861 | fn use_func<T>(a: i32, b: i32, func: T) -> i32 where T: Fn(i32, i32) -> i32 { |
| 862 | func(a, b) |
| 863 | } |
| 864 | |
| 865 | let sum = |a, b| a + b; |
| 866 | let prod = |a, b| a * b; |
nothing calls this directly
no outgoing calls
no test coverage detected