You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently missing antonymous predicate for is_some_and(Option) (or is_ok/err_and(Result)).
Motivation
Just as is_some has is_none as an antonym, is_xxx_and should also have an antonym. This doesn't add code to the standard library (in fact the majority of the code is in the documented code examples), but it makes the code logic clearer. (Maybe it's just that the antonym wasn't considered when this feature was originally designed.)
This issue contains an API change proposal (or ACP) and is part of the libs-api team feature lifecycle. Once this issue is filed, the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
We think this problem seems worth solving, and the standard library might be the right place to solve it.
We think that this probably doesn't belong in the standard library.
Second, if there's a concrete solution:
We think this specific solution looks roughly right, approved, you or someone else should implement this. (Further review will still happen on the subsequent implementation PR.)
We're not sure this is the right solution, and the alternatives or other materials don't give us enough information to be sure about that. Here are some questions we have that aren't answered, or rough ideas about alternatives we'd want to see discussed.
The text was updated successfully, but these errors were encountered:
Proposal
Problem statement
Currently missing antonymous predicate for
is_some_and
(Option
) (oris_ok/err_and
(Result
)).Motivation
Just as
is_some
hasis_none
as an antonym,is_xxx_and
should also have an antonym. This doesn't add code to the standard library (in fact the majority of the code is in the documented code examples), but it makes the code logic clearer. (Maybe it's just that the antonym wasn't considered when this feature was originally designed.)Solution sketch
Something like:
Alternatives
!is_some_and
?Links and related work
rust-lang/rust/pull/118090 - [Core] Add
is_xxx_or
forResult
andOption
What happens now?
This issue contains an API change proposal (or ACP) and is part of the libs-api team feature lifecycle. Once this issue is filed, the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
Second, if there's a concrete solution:
The text was updated successfully, but these errors were encountered: