-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.This PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
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<T> Result<T, T> {
pub const fn into_ok_or_err(self) -> T;
}Steps / History
- Implementation: Add a
Result::into_ok_or_errmethod to extract aTfromResult<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_errResult::ok_or_errResult::into_eitherResult::into_innerResult::either_valueResult::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?
csnover, fuchsnj, lukas-code, gtsiam, makspll and 1 morearniufaern, Aurora2500 and schneiderfelipe
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.This PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.