Skip to content

Commit

Permalink
stabilize Result::map_or_else
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Nov 12, 2019
1 parent 2de6c35 commit c06a8ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ impl<T, E> Result<T, E> {
/// Basic usage:
///
/// ```
/// #![feature(result_map_or_else)]
/// let k = 21;
///
/// let x : Result<_, &str> = Ok("foo");
Expand All @@ -539,7 +538,7 @@ impl<T, E> Result<T, E> {
/// assert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
/// ```
#[inline]
#[unstable(feature = "result_map_or_else", issue = "53268")]
#[stable(feature = "result_map_or_else", since = "1.41.0")]
pub fn map_or_else<U, D: FnOnce(E) -> U, F: FnOnce(T) -> U>(self, default: D, f: F) -> U {
match self {
Ok(t) => f(t),
Expand Down

0 comments on commit c06a8ea

Please sign in to comment.