Closed
Description
Feature gate: #![feature(bool_to_option)]
This is a tracking issue for bool::then_some
, a value-receiver version of bool::then
, split off from #64260.
Public API
impl bool {
pub fn then_some<T>(self, t: T) -> Option<T>;
}
Steps / History
- Implementation: Add methods for converting
bool
toOption<T>
#64255 - Final commenting period (FCP)
- Stabilization PR: Stabilize
bool::then_some
#96628
Unresolved Questions
- Do we actually want this method? There was concern that it didn't really pull its weight compared to
bool::then
. There was discussion in about this Tracking issue forbool::then_some
#64260