diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-08-30 12:15:53 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-08-30 12:15:53 -0700 |
| commit | 5c721bd8108476fb40bf3510002eba8e6eea4c91 (patch) | |
| tree | 014afe131a71cfb642732719f7d2a09db4860c1d /src/libstd | |
| parent | 470a3014673d25a9056fddcdea124890dacc41aa (diff) | |
| download | rust-5c721bd8108476fb40bf3510002eba8e6eea4c91.tar.gz rust-5c721bd8108476fb40bf3510002eba8e6eea4c91.zip | |
libstd: More test fixes
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/time.rs | 23 |
1 files changed, 23 insertions, 0 deletions
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, |
