From 5c721bd8108476fb40bf3510002eba8e6eea4c91 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 30 Aug 2012 12:15:53 -0700 Subject: libstd: More test fixes --- src/libstd/time.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/libstd') diff --git a/src/libstd/time.rs b/src/libstd/time.rs index c0466fb99f2..b8342ce8f88 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -90,10 +90,33 @@ type Tm_ = { tm_nsec: i32, // nanoseconds }; +impl Tm_ : Eq { + pure fn eq(&&other: Tm_) -> bool { + self.tm_sec == other.tm_sec && + self.tm_min == other.tm_min && + self.tm_hour == other.tm_hour && + self.tm_mday == other.tm_mday && + self.tm_mon == other.tm_mon && + self.tm_year == other.tm_year && + self.tm_wday == other.tm_wday && + self.tm_yday == other.tm_yday && + self.tm_isdst == other.tm_isdst && + self.tm_gmtoff == other.tm_gmtoff && + self.tm_zone == other.tm_zone && + self.tm_nsec == other.tm_nsec + } +} + enum Tm { Tm_(Tm_) } +impl Tm : Eq { + pure fn eq(&&other: Tm) -> bool { + *self == *other + } +} + fn empty_tm() -> Tm { Tm_({ tm_sec: 0_i32, -- cgit 1.4.1-3-g733a5