-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
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
Add Errors::execute method #262
Conversation
E: Error + Send + Sync + 'static, | ||
F: FnOnce() -> Result<(), E>, | ||
{ | ||
if let Err(e) = f() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused how this builds, does rust allow coercing from T -> () in return values or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, why do you think that would be the case?
bors r+ |
Build failed |
This allows using ? for error handling.
So this is once again something that only bors could catch. |
So let's try again ;) bors r+ |
Build succeeded |
This allows using ? for error handling.