@@ -1102,7 +1102,6 @@ impl<T: Default> Option<T> {
11021102 }
11031103}
11041104
1105- #[ unstable( feature = "inner_deref" , reason = "newly added" , issue = "50264" ) ]
11061105impl < T : Deref > Option < T > {
11071106 /// Converts from `Option<T>` (or `&Option<T>`) to `Option<&T::Target>`.
11081107 ///
@@ -1114,20 +1113,18 @@ impl<T: Deref> Option<T> {
11141113 /// # Examples
11151114 ///
11161115 /// ```
1117- /// #![feature(inner_deref)]
1118- ///
11191116 /// let x: Option<String> = Some("hey".to_owned());
11201117 /// assert_eq!(x.as_deref(), Some("hey"));
11211118 ///
11221119 /// let x: Option<String> = None;
11231120 /// assert_eq!(x.as_deref(), None);
11241121 /// ```
1122+ #[ stable( feature = "option_deref" , since = "1.40.0" ) ]
11251123 pub fn as_deref ( & self ) -> Option < & T :: Target > {
11261124 self . as_ref ( ) . map ( |t| t. deref ( ) )
11271125 }
11281126}
11291127
1130- #[ unstable( feature = "inner_deref" , reason = "newly added" , issue = "50264" ) ]
11311128impl < T : DerefMut > Option < T > {
11321129 /// Converts from `Option<T>` (or `&mut Option<T>`) to `Option<&mut T::Target>`.
11331130 ///
@@ -1137,14 +1134,13 @@ impl<T: DerefMut> Option<T> {
11371134 /// # Examples
11381135 ///
11391136 /// ```
1140- /// #![feature(inner_deref)]
1141- ///
11421137 /// let mut x: Option<String> = Some("hey".to_owned());
11431138 /// assert_eq!(x.as_deref_mut().map(|x| {
11441139 /// x.make_ascii_uppercase();
11451140 /// x
11461141 /// }), Some("HEY".to_owned().as_mut_str()));
11471142 /// ```
1143+ #[ stable( feature = "option_deref" , since = "1.40.0" ) ]
11481144 pub fn as_deref_mut ( & mut self ) -> Option < & mut T :: Target > {
11491145 self . as_mut ( ) . map ( |t| t. deref_mut ( ) )
11501146 }
0 commit comments