Skip to content
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

Merged
merged 1 commit into from
Sep 13, 2017
Merged

Add Errors::execute method #262

merged 1 commit into from
Sep 13, 2017

Conversation

torkleyy
Copy link
Member

This allows using ? for error handling.

@torkleyy torkleyy added the ready label Sep 12, 2017
E: Error + Send + Sync + 'static,
F: FnOnce() -> Result<(), E>,
{
if let Err(e) = f() {
Copy link
Member

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?

Copy link
Member Author

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?

@torkleyy
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Sep 13, 2017
262: Add Errors::execute method r=torkleyy a=torkleyy

This allows using ? for error handling.
@bors
Copy link
Contributor

bors bot commented Sep 13, 2017

Build failed

This allows using ? for error handling.
@torkleyy
Copy link
Member Author

So this is once again something that only bors could catch.

@torkleyy
Copy link
Member Author

So let's try again ;)

bors r+

bors bot added a commit that referenced this pull request Sep 13, 2017
262: Add Errors::execute method r=torkleyy a=torkleyy

This allows using ? for error handling.
@bors
Copy link
Contributor

bors bot commented Sep 13, 2017

Build succeeded

@bors bors bot merged commit c3ab501 into amethyst:master Sep 13, 2017
@torkleyy torkleyy deleted the errors branch September 13, 2017 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants