diff options
| author | Brian Anderson <banderson@mozilla.com> | 2014-06-30 15:43:13 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-06-30 15:44:36 -0700 |
| commit | fa5bc6f1bd703cb081b48d032713bf78499bf155 (patch) | |
| tree | 32e43aae0ac66d96bf7aa372896ad51da6a82d30 | |
| parent | 16a9258797436498a00726e8aea2ee8a85755e15 (diff) | |
| download | rust-fa5bc6f1bd703cb081b48d032713bf78499bf155.tar.gz rust-fa5bc6f1bd703cb081b48d032713bf78499bf155.zip | |
core: Remove the unnecessary 'traits' module from 'slice'
This is only breaking for code that references the empty `slice::traits` module. [breaking-change]
| -rw-r--r-- | src/libcore/slice.rs | 88 |
1 files changed, 39 insertions, 49 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index f1a694c974a..0178c0318b8 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -36,7 +36,7 @@ use mem::transmute; use clone::Clone; use collections::Collection; -use cmp::{PartialEq, Ord, Ordering, Less, Equal, Greater}; +use cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering, Less, Equal, Greater, Equiv}; use cmp; use default::Default; use iter::*; @@ -1422,59 +1422,49 @@ pub mod bytes { // Boilerplate traits // -#[allow(missing_doc)] -pub mod traits { - use super::*; - - use cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering, Equiv}; - use iter::order; - use collections::Collection; - use option::Option; - - impl<'a,T:PartialEq> PartialEq for &'a [T] { - fn eq(&self, other: & &'a [T]) -> bool { - self.len() == other.len() && - order::eq(self.iter(), other.iter()) - } - fn ne(&self, other: & &'a [T]) -> bool { - self.len() != other.len() || - order::ne(self.iter(), other.iter()) - } +impl<'a,T:PartialEq> PartialEq for &'a [T] { + fn eq(&self, other: & &'a [T]) -> bool { + self.len() == other.len() && + order::eq(self.iter(), other.iter()) + } + fn ne(&self, other: & &'a [T]) -> bool { + self.len() != other.len() || + order::ne(self.iter(), other.iter()) } +} - impl<'a,T:Eq> Eq for &'a [T] {} +impl<'a,T:Eq> Eq for &'a [T] {} - impl<'a,T:PartialEq, V: Vector<T>> Equiv<V> for &'a [T] { - #[inline] - fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() } - } +impl<'a,T:PartialEq, V: Vector<T>> Equiv<V> for &'a [T] { + #[inline] + fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() } +} - impl<'a,T:Ord> Ord for &'a [T] { - fn cmp(&self, other: & &'a [T]) -> Ordering { - order::cmp(self.iter(), other.iter()) - } +impl<'a,T:Ord> Ord for &'a [T] { + fn cmp(&self, other: & &'a [T]) -> Ordering { + order::cmp(self.iter(), other.iter()) } +} - impl<'a, T: PartialOrd> PartialOrd for &'a [T] { - #[inline] - fn partial_cmp(&self, other: &&'a [T]) -> Option<Ordering> { - order::partial_cmp(self.iter(), other.iter()) - } - #[inline] - fn lt(&self, other: & &'a [T]) -> bool { - order::lt(self.iter(), other.iter()) - } - #[inline] - fn le(&self, other: & &'a [T]) -> bool { - order::le(self.iter(), other.iter()) - } - #[inline] - fn ge(&self, other: & &'a [T]) -> bool { - order::ge(self.iter(), other.iter()) - } - #[inline] - fn gt(&self, other: & &'a [T]) -> bool { - order::gt(self.iter(), other.iter()) - } +impl<'a, T: PartialOrd> PartialOrd for &'a [T] { + #[inline] + fn partial_cmp(&self, other: &&'a [T]) -> Option<Ordering> { + order::partial_cmp(self.iter(), other.iter()) + } + #[inline] + fn lt(&self, other: & &'a [T]) -> bool { + order::lt(self.iter(), other.iter()) + } + #[inline] + fn le(&self, other: & &'a [T]) -> bool { + order::le(self.iter(), other.iter()) + } + #[inline] + fn ge(&self, other: & &'a [T]) -> bool { + order::ge(self.iter(), other.iter()) + } + #[inline] + fn gt(&self, other: & &'a [T]) -> bool { + order::gt(self.iter(), other.iter()) } } |
