We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
T
The text was updated successfully, but these errors were encountered:
fn callme<F>(callable: F) where F: Fn(i32) -> i32 { println!("{}", callable(12i32)); }
Sorry, something went wrong.
The closures section now includes an example covering this case. This should be fixed.
Thank you!
No branches or pull requests
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).
The text was updated successfully, but these errors were encountered: