@@ -1145,7 +1145,6 @@ impl<T, E: Into<!>> Result<T, E> {
1145
1145
}
1146
1146
}
1147
1147
1148
- #[ unstable( feature = "inner_deref" , issue = "50264" ) ]
1149
1148
impl < T : Deref , E > Result < T , E > {
1150
1149
/// Converts from `Result<T, E>` (or `&Result<T, E>`) to `Result<&<T as Deref>::Target, &E>`.
1151
1150
///
@@ -1155,7 +1154,6 @@ impl<T: Deref, E> Result<T, E> {
1155
1154
/// # Examples
1156
1155
///
1157
1156
/// ```
1158
- /// #![feature(inner_deref)]
1159
1157
/// let x: Result<String, u32> = Ok("hello".to_string());
1160
1158
/// let y: Result<&str, &u32> = Ok("hello");
1161
1159
/// assert_eq!(x.as_deref(), y);
@@ -1164,13 +1162,12 @@ impl<T: Deref, E> Result<T, E> {
1164
1162
/// let y: Result<&str, &u32> = Err(&42);
1165
1163
/// assert_eq!(x.as_deref(), y);
1166
1164
/// ```
1165
+ #[ stable( feature = "inner_deref" , since = "1.47.0" ) ]
1167
1166
pub fn as_deref ( & self ) -> Result < & T :: Target , & E > {
1168
1167
self . as_ref ( ) . map ( |t| t. deref ( ) )
1169
1168
}
1170
1169
}
1171
1170
1172
-
1173
- #[ unstable( feature = "inner_deref" , issue = "50264" ) ]
1174
1171
impl < T : DerefMut , E > Result < T , E > {
1175
1172
/// Converts from `Result<T, E>` (or `&mut Result<T, E>`) to `Result<&mut <T as DerefMut>::Target, &mut E>`.
1176
1173
///
@@ -1180,7 +1177,6 @@ impl<T: DerefMut, E> Result<T, E> {
1180
1177
/// # Examples
1181
1178
///
1182
1179
/// ```
1183
- /// #![feature(inner_deref)]
1184
1180
/// let mut s = "HELLO".to_string();
1185
1181
/// let mut x: Result<String, u32> = Ok("hello".to_string());
1186
1182
/// let y: Result<&mut str, &mut u32> = Ok(&mut s);
@@ -1191,6 +1187,7 @@ impl<T: DerefMut, E> Result<T, E> {
1191
1187
/// let y: Result<&mut str, &mut u32> = Err(&mut i);
1192
1188
/// assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
1193
1189
/// ```
1190
+ #[ stable( feature = "inner_deref" , since = "1.47.0" ) ]
1194
1191
pub fn as_deref_mut ( & mut self ) -> Result < & mut T :: Target , & mut E > {
1195
1192
self . as_mut ( ) . map ( |t| t. deref_mut ( ) )
1196
1193
}
0 commit comments