diff options
Diffstat (limited to 'src/libcore/either.rs')
| -rw-r--r-- | src/libcore/either.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/libcore/either.rs b/src/libcore/either.rs index 878fd81651a..74b29f3a5f1 100644 --- a/src/libcore/either.rs +++ b/src/libcore/either.rs @@ -18,6 +18,7 @@ use cmp::Eq; use result::Result; /// The either type +#[deriving_eq] pub enum Either<T, U> { Left(T), Right(U) @@ -141,26 +142,6 @@ pub pure fn unwrap_right<T,U>(eith: Either<T,U>) -> U { } } -impl<T:Eq,U:Eq> Either<T,U> : Eq { - pure fn eq(&self, other: &Either<T,U>) -> bool { - match (*self) { - Left(ref a) => { - match (*other) { - Left(ref b) => (*a).eq(b), - Right(_) => false - } - } - Right(ref a) => { - match (*other) { - Left(_) => false, - Right(ref b) => (*a).eq(b) - } - } - } - } - pure fn ne(&self, other: &Either<T,U>) -> bool { !(*self).eq(other) } -} - #[test] fn test_either_left() { let val = Left(10); |
