diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2014-02-24 08:11:00 -0500 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2014-03-07 22:45:22 -0500 |
| commit | 4d7d101a76deea69e9078d9ed6bb93ecca70e52a (patch) | |
| tree | 3365108e59d5c6d4ee0655347ce3ed447cc7d016 /src/libstd/vec.rs | |
| parent | 33768c46ec980a911284d77804e5e45ead6530eb (diff) | |
| download | rust-4d7d101a76deea69e9078d9ed6bb93ecca70e52a.tar.gz rust-4d7d101a76deea69e9078d9ed6bb93ecca70e52a.zip | |
create a sensible comparison trait hierarchy
* `Ord` inherits from `Eq` * `TotalOrd` inherits from `TotalEq` * `TotalOrd` inherits from `Ord` * `TotalEq` inherits from `Eq` This is a partial implementation of #12517.
Diffstat (limited to 'src/libstd/vec.rs')
| -rw-r--r-- | src/libstd/vec.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 59136c99ec9..69bf5f5d0fc 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -682,7 +682,7 @@ pub mod traits { fn cmp(&self, other: &~[T]) -> Ordering { self.as_slice().cmp(&other.as_slice()) } } - impl<'a, T: Eq + Ord> Ord for &'a [T] { + impl<'a, T: Ord> Ord for &'a [T] { fn lt(&self, other: & &'a [T]) -> bool { order::lt(self.iter(), other.iter()) } @@ -700,7 +700,7 @@ pub mod traits { } } - impl<T: Eq + Ord> Ord for ~[T] { + impl<T: Ord> Ord for ~[T] { #[inline] fn lt(&self, other: &~[T]) -> bool { self.as_slice() < other.as_slice() } #[inline] |
