From 65af429c681e874bee6fb3a864ae3496517a72f4 Mon Sep 17 00:00:00 2001 From: Ethan Brierley Date: Tue, 24 Sep 2019 20:19:32 +0100 Subject: [PATCH] Stabilize `Option::flatten` --- src/liballoc/tests/lib.rs | 1 - src/libcore/option.rs | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index 676874c8b27df..79e5ba340b784 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -3,7 +3,6 @@ #![feature(drain_filter)] #![feature(exact_size_is_empty)] #![feature(new_uninit)] -#![feature(option_flattening)] #![feature(pattern)] #![feature(trusted_len)] #![feature(try_reserve)] diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 47e3a0d21676f..a0f09fabb3456 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -1568,7 +1568,6 @@ impl Option> { /// # Examples /// Basic usage: /// ``` - /// #![feature(option_flattening)] /// let x: Option> = Some(Some(6)); /// assert_eq!(Some(6), x.flatten()); /// @@ -1580,13 +1579,12 @@ impl Option> { /// ``` /// Flattening once only removes one level of nesting: /// ``` - /// #![feature(option_flattening)] /// let x: Option>> = Some(Some(Some(6))); /// assert_eq!(Some(Some(6)), x.flatten()); /// assert_eq!(Some(6), x.flatten().flatten()); /// ``` #[inline] - #[unstable(feature = "option_flattening", issue = "60258")] + #[stable(feature = "option_flattening", since = "1.40.0")] pub fn flatten(self) -> Option { self.and_then(convert::identity) }