-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
humanenginuity/rust
#1Labels
A-result-optionArea: Result and Option combinatorsArea: Result and Option combinatorsB-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-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-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge 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
API
impl<T, E> Result<T, E> {
fn as_deref(&self) -> Result<&T::Target, &E> where T: Deref;
fn as_deref_err(&self) -> Result<&T, &E::Target> where E: Deref;
fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> where T: DerefMut;
fn as_deref_mut_err(&mut self) -> Result<&mut T, &mut E::Target> where E: DerefMut;
}
Implementation history
-
Implemented in Implement inner deref for Option and Result #50267 as:
impl<T> Option<T> { fn deref(&self) -> Option<&T::Target> where T: Deref; } impl<T, E> Result<T, E> { fn deref(&self) -> Result<&T::Target, &E::Target> where T: Deref, E: Deref; fn deref_ok(&self) -> Result<&T::Target, &E> where T: Deref; fn deref_err(&self) -> Result<&T, &E::Target> where E: Deref; }
-
Renamed and extended in
as_deref()
andas_deref_mut()
impls #59628 / Introduceas_deref
to Option #62421:impl<T> Option<T> { fn as_deref(&self) -> Option<&T::Target> where T: Deref; fn as_deref_mut(&mut self) -> Option<&mut T::Target> where T: DerefMut; } impl<T, E> Result<T, E> { fn as_deref(&self) -> Result<&T::Target, &E::Target> where T: Deref, E: Deref; fn as_deref_ok(&self) -> Result<&T::Target, &E> where T: Deref; fn as_deref_err(&self) -> Result<&T, &E::Target> where E: Deref; fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E::Target> where T: DerefMut, E: DerefMut; fn as_deref_mut_ok(&mut self) -> Result<&mut T::Target, &mut E> where T: DerefMut; fn as_deref_mut_err(&mut self) -> Result<&mut T, &mut E::Target> where E: DerefMut; }
-
Option
methods stabilized in StabilizeOption::as_deref
andOption::as_deref_mut
#64708:impl<T> Option<T> { fn as_deref(&self) -> Option<&T::Target> where T: Deref; fn as_deref_mut(&mut self) -> Option<&mut T::Target> where T: DerefMut; }
-
Result
methods pared down and renamed in Rename Result::as_deref_ok to as_deref #67930:impl<T, E> Result<T, E> { fn as_deref(&self) -> Result<&T::Target, &E> where T: Deref; fn as_deref_err(&self) -> Result<&T, &E::Target> where E: Deref; fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> where T: DerefMut; fn as_deref_mut_err(&mut self) -> Result<&mut T, &mut E::Target> where E: DerefMut; }
galich, ehuss, oxalica, H2CO3, thomcc and 14 more
Metadata
Metadata
Assignees
Labels
A-result-optionArea: Result and Option combinatorsArea: Result and Option combinatorsB-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-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-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.