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/libcore/cmp.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/libcore/cmp.rs')
| -rw-r--r-- | src/libcore/cmp.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 6647963bc5e..82a830d05cd 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -26,11 +26,13 @@ trait Ord { #[lang="eq"] trait Eq { pure fn eq(&&other: self) -> bool; + pure fn ne(&&other: self) -> bool; } #[cfg(test)] trait Eq { pure fn eq(&&other: self) -> bool; + pure fn ne(&&other: self) -> bool; } pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool { @@ -45,6 +47,10 @@ pure fn eq<T: Eq>(v1: &T, v2: &T) -> bool { v1.eq(v2) } +pure fn ne<T: Eq>(v1: &T, v2: &T) -> bool { + v1.ne(v2) +} + pure fn ge<T: Ord>(v1: &T, v2: &T) -> bool { v1.ge(v2) } |
