core: Remove the unnecessary 'traits' module from 'slice'
This is only breaking for code that references the empty `slice::traits` module. [breaking-change]
This commit is contained in:
parent
16a9258797
commit
fa5bc6f1bd
|
@ -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,16 +1422,7 @@ 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] {
|
||||
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())
|
||||
|
@ -1440,22 +1431,22 @@ pub mod traits {
|
|||
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] {
|
||||
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] {
|
||||
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] {
|
||||
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())
|
||||
|
@ -1476,5 +1467,4 @@ pub mod traits {
|
|||
fn gt(&self, other: & &'a [T]) -> bool {
|
||||
order::gt(self.iter(), other.iter())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue