diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-09-07 12:06:02 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-09-07 12:24:48 -0700 |
| commit | feb014eb3c3aa1ccaae1df407801dffa090499fd (patch) | |
| tree | 8ffeec6945de4843f9e0d150720596327530e00f /src/libstd/time.rs | |
| parent | ac1f84c153a171e641233e5d2d11404a0b520986 (diff) | |
| download | rust-feb014eb3c3aa1ccaae1df407801dffa090499fd.tar.gz rust-feb014eb3c3aa1ccaae1df407801dffa090499fd.zip | |
rustc: Add an "ne" method to the Eq trait, and implement it everywhere
Diffstat (limited to 'src/libstd/time.rs')
| -rw-r--r-- | src/libstd/time.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/time.rs b/src/libstd/time.rs index 86104c117b5..c012ac8fa05 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -40,6 +40,7 @@ impl Timespec : Eq { pure fn eq(&&other: Timespec) -> bool { self.sec == other.sec && self.nsec == other.nsec } + pure fn ne(&&other: Timespec) -> bool { !self.eq(other) } } /** @@ -105,6 +106,7 @@ impl Tm_ : Eq { self.tm_zone == other.tm_zone && self.tm_nsec == other.tm_nsec } + pure fn ne(&&other: Tm_) -> bool { !self.eq(other) } } enum Tm { @@ -112,9 +114,8 @@ enum Tm { } impl Tm : Eq { - pure fn eq(&&other: Tm) -> bool { - *self == *other - } + pure fn eq(&&other: Tm) -> bool { *self == *other } + pure fn ne(&&other: Tm) -> bool { *self != *other } } fn empty_tm() -> Tm { |
