-
Notifications
You must be signed in to change notification settings - Fork 190
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
use ?
instead of try!
#158
Conversation
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.
(Although I don't think try!
is deprecated, is it? Not recommended for sure, but does it print a warning?)
my bad, the warnings appear only on the nightly toolchain |
Does it affect generated code? |
@niklasad1 can you rebase please? :) |
The binaries are not identical but I benched the following: pub fn try_operator(a: Result<usize, usize>) -> Result<usize, usize> {
Ok(a?)
}
pub fn try_macro(a: Result<usize, usize>) -> Result<usize, usize> {
Ok(r#try!(a))
}
|
The problem was with more complex (nested) expressions and the compiler not being able to optimize the overhead away. I think it's fine in our case. |
No description provided.