Skip to content

Commit a5f4239

Browse files
committed
Rename Result::as_deref_ok to as_deref
1 parent e621797 commit a5f4239

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

src/libcore/result.rs

+2-25
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ impl<T: Deref, E> Result<T, E> {
11361136
///
11371137
/// Leaves the original `Result` in-place, creating a new one containing a reference to the
11381138
/// `Ok` type's `Deref::Target` type.
1139-
pub fn as_deref_ok(&self) -> Result<&T::Target, &E> {
1139+
pub fn as_deref(&self) -> Result<&T::Target, &E> {
11401140
self.as_ref().map(|t| t.deref())
11411141
}
11421142
}
@@ -1152,24 +1152,13 @@ impl<T, E: Deref> Result<T, E> {
11521152
}
11531153
}
11541154

1155-
#[unstable(feature = "inner_deref", reason = "newly added", issue = "50264")]
1156-
impl<T: Deref, E: Deref> Result<T, E> {
1157-
/// Converts from `Result<T, E>` (or `&Result<T, E>`) to `Result<&T::Target, &E::Target>`.
1158-
///
1159-
/// Leaves the original `Result` in-place, creating a new one containing a reference to both
1160-
/// the `Ok` and `Err` types' `Deref::Target` types.
1161-
pub fn as_deref(&self) -> Result<&T::Target, &E::Target> {
1162-
self.as_ref().map(|t| t.deref()).map_err(|e| e.deref())
1163-
}
1164-
}
1165-
11661155
#[unstable(feature = "inner_deref", reason = "newly added", issue = "50264")]
11671156
impl<T: DerefMut, E> Result<T, E> {
11681157
/// Converts from `Result<T, E>` (or `&mut Result<T, E>`) to `Result<&mut T::Target, &mut E>`.
11691158
///
11701159
/// Leaves the original `Result` in-place, creating a new one containing a mutable reference to
11711160
/// the `Ok` type's `Deref::Target` type.
1172-
pub fn as_deref_mut_ok(&mut self) -> Result<&mut T::Target, &mut E> {
1161+
pub fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> {
11731162
self.as_mut().map(|t| t.deref_mut())
11741163
}
11751164
}
@@ -1185,18 +1174,6 @@ impl<T, E: DerefMut> Result<T, E> {
11851174
}
11861175
}
11871176

1188-
#[unstable(feature = "inner_deref", reason = "newly added", issue = "50264")]
1189-
impl<T: DerefMut, E: DerefMut> Result<T, E> {
1190-
/// Converts from `Result<T, E>` (or `&mut Result<T, E>`) to
1191-
/// `Result<&mut T::Target, &mut E::Target>`.
1192-
///
1193-
/// Leaves the original `Result` in-place, creating a new one containing a mutable reference to
1194-
/// both the `Ok` and `Err` types' `Deref::Target` types.
1195-
pub fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E::Target> {
1196-
self.as_mut().map(|t| t.deref_mut()).map_err(|e| e.deref_mut())
1197-
}
1198-
}
1199-
12001177
impl<T, E> Result<Option<T>, E> {
12011178
/// Transposes a `Result` of an `Option` into an `Option` of a `Result`.
12021179
///

0 commit comments

Comments
 (0)