about summary refs log tree commit diff
path: root/src/libcore/result.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/result.rs')
-rw-r--r--src/libcore/result.rs21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index d575655f7a5..a1e7df28872 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -19,6 +19,7 @@ use cmp::Eq;
 use either::Either;
 
 /// The result type
+#[deriving_eq]
 pub enum Result<T, U> {
     /// Contains the successful result value
     Ok(T),
@@ -374,26 +375,6 @@ pub fn unwrap_err<T, U>(res: Result<T, U>) -> U {
     }
 }
 
-impl<T:Eq,U:Eq> Result<T,U> : Eq {
-    pure fn eq(&self, other: &Result<T,U>) -> bool {
-        match (*self) {
-            Ok(ref e0a) => {
-                match (*other) {
-                    Ok(ref e0b) => *e0a == *e0b,
-                    _ => false
-                }
-            }
-            Err(ref e0a) => {
-                match (*other) {
-                    Err(ref e0b) => *e0a == *e0b,
-                    _ => false
-                }
-            }
-        }
-    }
-    pure fn ne(&self, other: &Result<T,U>) -> bool { !(*self).eq(other) }
-}
-
 #[cfg(test)]
 #[allow(non_implicitly_copyable_typarams)]
 mod tests {