-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
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.
Description
Feature gate: #![feature("result_option_map_or_default")]
This is a tracking issue for adding Result::map_or_default()
and Option::map_or_default()
. Open RFC rust-lang/rfcs#3148
Public API
// core::result
impl<T, E> Result<T, E> {
pub fn map_or_default<U, F>(self, f: F) -> U
where
U: Default,
F: FnOnce(T) -> U { .. }
}
// core::option
impl<T> Option<T> {
pub fn map_or_default<U, F>(self, f: F) -> U
where
U: Default,
F: FnOnce(T) -> U { .. }
}
Steps / History
- Implementation: Add
Result::map_or_default
andOption::map_or_default
#141659 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
nik-rev, regar42, tkr-sh and LinusU
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.