]> git.lizzy.rs Git - rust.git/commitdiff
stabilize Result::map_or
authorLzu Tao <taolzu@gmail.com>
Wed, 20 Nov 2019 09:42:02 +0000 (09:42 +0000)
committerLzu Tao <taolzu@gmail.com>
Mon, 2 Dec 2019 06:25:12 +0000 (06:25 +0000)
src/libcore/result.rs

index 1a0845f3a6dda5a16fd84bd873ee6fc8f8ae6273..fb4dc62d8c176dacdf653d00cd371d998a211195 100644 (file)
@@ -520,7 +520,6 @@ pub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> Result<U,E> {
     /// # Examples
     ///
     /// ```
-    /// #![feature(result_map_or)]
     /// let x: Result<_, &str> = Ok("foo");
     /// assert_eq!(x.map_or(42, |v| v.len()), 3);
     ///
@@ -528,7 +527,7 @@ pub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> Result<U,E> {
     /// assert_eq!(x.map_or(42, |v| v.len()), 42);
     /// ```
     #[inline]
-    #[unstable(feature = "result_map_or", issue = "66293")]
+    #[stable(feature = "result_map_or", since = "1.41.0")]
     pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U {
         match self {
             Ok(t) => f(t),