Closed
Description
The example uses preexisting functions accepting closures, but doesn't show how to create one.
I'm struggling with this, because the compiler won't infer the closure type, and closure types were not explained (related #405).
fn callme<T>(callable: T) {
callable(12i32);
}
fn main() {
callme(|&:arg| -arg);
}
error: expected function, found
T
Metadata
Metadata
Assignees
Labels
No labels