Tracking Issue for Result::into_ok_or_err
/ feature(result_into_ok_or_err)
· Issue #82223 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Feature gate: #![feature(result_into_ok_or_err)]
This is a tracking issue for Result::into_ok_or_err
, a method to get the T
out of Result<T, T>
regardless of which variant is active.
Public API
impl Result<T, T> { pub const fn into_ok_or_err(self) -> T; }
Steps / History
- Implementation: Add a Result::into_ok_or_err method to extract a T from Result<T, T> #80572
- Final commenting period (FCP)
- Stabilization PR
Unresolved Questions
What color should the bikeshed beWhat name should it have?
Some options that have been suggested:Result::into_ok_or_err
Result::ok_or_err
Result::into_either
Result::into_inner
Result::either_value
Result::unwrap_either
- Several more suggested options are listed in the issue.
- Do we want a reference version as well, as add Result::{value, into_value} #79315 proposed?