Skip to content

Commit fa5bc6f

Browse files
committed
core: Remove the unnecessary 'traits' module from 'slice'
This is only breaking for code that references the empty `slice::traits` module. [breaking-change]
1 parent 16a9258 commit fa5bc6f

File tree

1 file changed

+39
-49
lines changed

1 file changed

+39
-49
lines changed

src/libcore/slice.rs

+39-49
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
use mem::transmute;
3737
use clone::Clone;
3838
use collections::Collection;
39-
use cmp::{PartialEq, Ord, Ordering, Less, Equal, Greater};
39+
use cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering, Less, Equal, Greater, Equiv};
4040
use cmp;
4141
use default::Default;
4242
use iter::*;
@@ -1422,59 +1422,49 @@ pub mod bytes {
14221422
// Boilerplate traits
14231423
//
14241424

1425-
#[allow(missing_doc)]
1426-
pub mod traits {
1427-
use super::*;
1428-
1429-
use cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering, Equiv};
1430-
use iter::order;
1431-
use collections::Collection;
1432-
use option::Option;
1433-
1434-
impl<'a,T:PartialEq> PartialEq for &'a [T] {
1435-
fn eq(&self, other: & &'a [T]) -> bool {
1436-
self.len() == other.len() &&
1437-
order::eq(self.iter(), other.iter())
1438-
}
1439-
fn ne(&self, other: & &'a [T]) -> bool {
1440-
self.len() != other.len() ||
1441-
order::ne(self.iter(), other.iter())
1442-
}
1425+
impl<'a,T:PartialEq> PartialEq for &'a [T] {
1426+
fn eq(&self, other: & &'a [T]) -> bool {
1427+
self.len() == other.len() &&
1428+
order::eq(self.iter(), other.iter())
1429+
}
1430+
fn ne(&self, other: & &'a [T]) -> bool {
1431+
self.len() != other.len() ||
1432+
order::ne(self.iter(), other.iter())
14431433
}
1434+
}
14441435

1445-
impl<'a,T:Eq> Eq for &'a [T] {}
1436+
impl<'a,T:Eq> Eq for &'a [T] {}
14461437

1447-
impl<'a,T:PartialEq, V: Vector<T>> Equiv<V> for &'a [T] {
1448-
#[inline]
1449-
fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
1450-
}
1438+
impl<'a,T:PartialEq, V: Vector<T>> Equiv<V> for &'a [T] {
1439+
#[inline]
1440+
fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
1441+
}
14511442

1452-
impl<'a,T:Ord> Ord for &'a [T] {
1453-
fn cmp(&self, other: & &'a [T]) -> Ordering {
1454-
order::cmp(self.iter(), other.iter())
1455-
}
1443+
impl<'a,T:Ord> Ord for &'a [T] {
1444+
fn cmp(&self, other: & &'a [T]) -> Ordering {
1445+
order::cmp(self.iter(), other.iter())
14561446
}
1447+
}
14571448

1458-
impl<'a, T: PartialOrd> PartialOrd for &'a [T] {
1459-
#[inline]
1460-
fn partial_cmp(&self, other: &&'a [T]) -> Option<Ordering> {
1461-
order::partial_cmp(self.iter(), other.iter())
1462-
}
1463-
#[inline]
1464-
fn lt(&self, other: & &'a [T]) -> bool {
1465-
order::lt(self.iter(), other.iter())
1466-
}
1467-
#[inline]
1468-
fn le(&self, other: & &'a [T]) -> bool {
1469-
order::le(self.iter(), other.iter())
1470-
}
1471-
#[inline]
1472-
fn ge(&self, other: & &'a [T]) -> bool {
1473-
order::ge(self.iter(), other.iter())
1474-
}
1475-
#[inline]
1476-
fn gt(&self, other: & &'a [T]) -> bool {
1477-
order::gt(self.iter(), other.iter())
1478-
}
1449+
impl<'a, T: PartialOrd> PartialOrd for &'a [T] {
1450+
#[inline]
1451+
fn partial_cmp(&self, other: &&'a [T]) -> Option<Ordering> {
1452+
order::partial_cmp(self.iter(), other.iter())
1453+
}
1454+
#[inline]
1455+
fn lt(&self, other: & &'a [T]) -> bool {
1456+
order::lt(self.iter(), other.iter())
1457+
}
1458+
#[inline]
1459+
fn le(&self, other: & &'a [T]) -> bool {
1460+
order::le(self.iter(), other.iter())
1461+
}
1462+
#[inline]
1463+
fn ge(&self, other: & &'a [T]) -> bool {
1464+
order::ge(self.iter(), other.iter())
1465+
}
1466+
#[inline]
1467+
fn gt(&self, other: & &'a [T]) -> bool {
1468+
order::gt(self.iter(), other.iter())
14791469
}
14801470
}

0 commit comments

Comments
 (0)