Recently const control flow was stabilized, which enables a lot of methods within the standard library to be made stable const; specifically all of the enum is_variant methods:
Option: is_some and is_none
Result: is_ok and is_err
Poll: is_ready and is_pending
Cow: is_borrowed and is_owned (methods themselves are unstable)
IpAddr: is_ipv4 and is_ipv6
std::path::Prefix: is_verbatim
This issue aims to collect discussion about the stabilization of these methods, due to their similarities and trivial implementations.
Stabilization
Recently const control flow was stabilized, which enables a lot of methods within the standard library to be made stable const; specifically all of the enum
is_variantmethods:Option:is_someandis_noneResult:is_okandis_errPoll:is_readyandis_pendingCow:is_borrowedandis_owned(methods themselves are unstable)IpAddr:is_ipv4andis_ipv6std::path::Prefix:is_verbatimThis issue aims to collect discussion about the stabilization of these methods, due to their similarities and trivial implementations.
Stabilization
Option: stabilized in PR#76135 (note: also containsas_ref)Result: stabilized in PR#76136 (note: also containsas_ref)Pollstabilized in PR#76227Cow: methods made const in PR#76139, the methods themselves are still unstable undercow_is_borrowedIpAddr: stabilized in PR#76226Prefix: stabilization proposed in PR#76232, but there is not enough motivation to stabilize this method on its own