Skip to content

Commit 8cae411

Browse files
committed
stabilize Result::map_or
1 parent f5c81e0 commit 8cae411

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libcore/result.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -520,15 +520,14 @@ impl<T, E> Result<T, E> {
520520
/// # Examples
521521
///
522522
/// ```
523-
/// #![feature(result_map_or)]
524523
/// let x: Result<_, &str> = Ok("foo");
525524
/// assert_eq!(x.map_or(42, |v| v.len()), 3);
526525
///
527526
/// let x: Result<&str, _> = Err("bar");
528527
/// assert_eq!(x.map_or(42, |v| v.len()), 42);
529528
/// ```
530529
#[inline]
531-
#[unstable(feature = "result_map_or", issue = "66293")]
530+
#[stable(feature = "result_map_or", since = "1.41.0")]
532531
pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U {
533532
match self {
534533
Ok(t) => f(t),

0 commit comments

Comments
 (0)