-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Option::is_none_or
#100602
Add Option::is_none_or
#100602
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thomcc (or someone else) soon. Please see the contribution instructions for more information. |
Hi, this is a new unstable API, so you need to file an ACP for this. See the bots message for the process. Thanks. |
/// ``` | ||
#[must_use] | ||
#[inline] | ||
#[unstable(feature = "is_some_with", issue = "93050")] |
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.
#[unstable(feature = "is_some_with", issue = "93050")] | |
#[unstable(feature = "option_is_none_or", issue = "none")] |
For now. But you can wait for the ACP to be resolved.
r? @m-ou-se |
Ah, I didn't see the message about the tracking issue (or perhaps you edited it). I guess this possibly can skip ACP? No strong feelings from me either way. |
I'm guessing it would be part of the |
I should also mention that, based on a rudimentary Godbolt test, this new method seems to optimize nicely. |
Can we have I ran into a case the other day where I wanted to write: .filter(|r| r.is_err_or(|value| value.something()))
.collect::<Result<_, _>(); |
I think this case might be sufficiently covered by |
Thanks for your PR. I'm closing this as we decided not to add this method to Option. See rust-lang/libs-team#212. |
This is my first contribution to Rust, so I welcome any churn no matter how pedantic. :)
This was discussed on this tracking issue.