A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rust-lang/rust/issues/138099 below:

map_or_default` · Issue #138099 · rust-lang/rust · GitHub

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 Unresolved Questions
  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

nik-rev, regar42, tkr-sh and LinusU


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4