about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-15 00:46:28 -0700
committerbors <bors@rust-lang.org>2014-03-15 00:46:28 -0700
commit1d828eb3a4f63c38231c1fdc0aa2197a9b2a333f (patch)
treea86b53da6e6a9cd129d5635f179d134f675b1489
parentfc7a112808fa918fa76c39ebd324bc5d19bc66e1 (diff)
parent8e53d61afe1c86954688455956e86a69956f483c (diff)
downloadrust-1d828eb3a4f63c38231c1fdc0aa2197a9b2a333f.tar.gz
rust-1d828eb3a4f63c38231c1fdc0aa2197a9b2a333f.zip
auto merge of #12906 : sfackler/rust/timespec-total, r=thestinger
-rw-r--r--src/libtime/lib.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/libtime/lib.rs b/src/libtime/lib.rs
index 019ad2c4b4c..a3ddf35b69b 100644
--- a/src/libtime/lib.rs
+++ b/src/libtime/lib.rs
@@ -63,9 +63,7 @@ mod imp {
 }
 
 /// A record specifying a time value in seconds and nanoseconds.
-
-
-#[deriving(Clone, Eq, Encodable, Decodable, Show)]
+#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, Encodable, Decodable, Show)]
 pub struct Timespec { sec: i64, nsec: i32 }
 /*
  * Timespec assumes that pre-epoch Timespecs have negative sec and positive
@@ -82,13 +80,6 @@ impl Timespec {
     }
 }
 
-impl Ord for Timespec {
-    fn lt(&self, other: &Timespec) -> bool {
-        self.sec < other.sec ||
-            (self.sec == other.sec && self.nsec < other.nsec)
-    }
-}
-
 /**
  * Returns the current time as a `timespec` containing the seconds and
  * nanoseconds since 1970-01-01T00:00:00Z.