-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 Result::
{value
, into_value
}
#79315
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
The question is whether the name |
Those use cases don't need to clash: We could implement |
c537aee
to
b5e8289
Compare
Maybe there's a name that's more descriptive of what it does? Do you have any examples where this would be useful other than |
There's |
This could be another use case: #80486 |
Triage: What's next steps here? |
r? @m-ou-se |
Ah, it looks like #80572 was a duplicate of this. |
☔ The latest upstream changes (presumably #82241) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks again for your PR. I'm closing this, as #80572 was merged, which adds the same function (although with a different name). The reference version was not added by that PR, but that option was added as an open question to the tracking issue. Feel free to add your comments there. |
Recently using
binary_search
, I found that I had to manually match theResult
to get the value of the insertion point (and in my use case I didn't need to care about whether it wasOk
orErr
). So I thought this method was missing fromResult
.The implementation might be possible to optimize further, but this is a safe initial version.