Skip to content

Commit 61e5286

Browse files
committed
Remove Err variants of cloned and copied
1 parent 9733f0d commit 61e5286

File tree

1 file changed

+0
-79
lines changed

1 file changed

+0
-79
lines changed

src/libcore/result.rs

-79
Original file line numberDiff line numberDiff line change
@@ -860,46 +860,6 @@ impl<T: Copy, E> Result<&mut T, E> {
860860
}
861861
}
862862

863-
impl<T, E: Copy> Result<T, &E> {
864-
/// Maps a `Result<T, &E>` to a `Result<T, E>` by copying the contents of the
865-
/// `Err` part.
866-
///
867-
/// # Examples
868-
///
869-
/// ```
870-
/// #![feature(result_copied)]
871-
/// let val = 12;
872-
/// let x: Result<i32, &i32> = Err(&val);
873-
/// assert_eq!(x, Err(&12));
874-
/// let copied = x.copied_err();
875-
/// assert_eq!(copied, Err(12));
876-
/// ```
877-
#[unstable(feature = "result_copied", reason = "newly added", issue = "63168")]
878-
pub fn copied_err(self) -> Result<T, E> {
879-
self.map_err(|&e| e)
880-
}
881-
}
882-
883-
impl<T, E: Copy> Result<T, &mut E> {
884-
/// Maps a `Result<T, &mut E>` to a `Result<T, E>` by copying the contents of the
885-
/// `Err` part.
886-
///
887-
/// # Examples
888-
///
889-
/// ```
890-
/// #![feature(result_copied)]
891-
/// let mut val = 12;
892-
/// let x: Result<i32, &mut i32> = Err(&mut val);
893-
/// assert_eq!(x, Err(&mut 12));
894-
/// let copied = x.copied_err();
895-
/// assert_eq!(copied, Err(12));
896-
/// ```
897-
#[unstable(feature = "result_copied", reason = "newly added", issue = "63168")]
898-
pub fn copied_err(self) -> Result<T, E> {
899-
self.map_err(|&mut e| e)
900-
}
901-
}
902-
903863
impl<T: Clone, E> Result<&T, E> {
904864
/// Maps a `Result<&T, E>` to a `Result<T, E>` by cloning the contents of the
905865
/// `Ok` part.
@@ -940,45 +900,6 @@ impl<T: Clone, E> Result<&mut T, E> {
940900
}
941901
}
942902

943-
impl<T, E: Clone> Result<T, &E> {
944-
/// Maps a `Result<T, &E>` to a `Result<T, E>` by cloning the contents of the
945-
/// `Err` part.
946-
///
947-
/// # Examples
948-
///
949-
/// ```
950-
/// #![feature(result_cloned)]
951-
/// let val = 12;
952-
/// let x: Result<i32, &i32> = Err(&val);
953-
/// assert_eq!(x, Err(&12));
954-
/// let cloned = x.cloned_err();
955-
/// assert_eq!(cloned, Err(12));
956-
/// ```
957-
#[unstable(feature = "result_cloned", reason = "newly added", issue = "63168")]
958-
pub fn cloned_err(self) -> Result<T, E> {
959-
self.map_err(|e| e.clone())
960-
}
961-
}
962-
963-
impl<T, E: Clone> Result<T, &mut E> {
964-
/// Maps a `Result<T, &mut E>` to a `Result<T, E>` by cloning the contents of the
965-
/// `Err` part.
966-
///
967-
/// # Examples
968-
///
969-
/// ```
970-
/// #![feature(result_cloned)]
971-
/// let mut val = 12;
972-
/// let x: Result<i32, &mut i32> = Err(&mut val);
973-
/// assert_eq!(x, Err(&mut 12));
974-
/// let cloned = x.cloned_err();
975-
/// assert_eq!(cloned, Err(12));
976-
/// ```
977-
#[unstable(feature = "result_cloned", reason = "newly added", issue = "63168")]
978-
pub fn cloned_err(self) -> Result<T, E> {
979-
self.map_err(|e| e.clone())
980-
}
981-
}
982903

983904
impl<T, E: fmt::Debug> Result<T, E> {
984905
/// Unwraps a result, yielding the content of an [`Ok`].

0 commit comments

Comments
 (0)