about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-09 00:17:06 -0700
committerbors <bors@rust-lang.org>2013-08-09 00:17:06 -0700
commit094e4260f8b0a1d1cddf235373d2588cefd167b9 (patch)
treee82c9a44184d9d08df776832e76c9083ae3696da /src/libstd
parenta931e04b757a795e3867ea98c81cee731bd54ac1 (diff)
parentb4d6ae5bb8959affdb91a6b6791e725f97787344 (diff)
downloadrust-094e4260f8b0a1d1cddf235373d2588cefd167b9.tar.gz
rust-094e4260f8b0a1d1cddf235373d2588cefd167b9.zip
auto merge of #8357 : omasanori/rust/cleanup, r=alexcrichton
I feel it's time to eliminate them (and add some testcases.)
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/bool.rs6
-rw-r--r--src/libstd/char.rs6
-rw-r--r--src/libstd/cmp.rs9
-rw-r--r--src/libstd/nil.rs6
-rw-r--r--src/libstd/num/int_macros.rs6
-rw-r--r--src/libstd/num/uint_macros.rs6
-rw-r--r--src/libstd/str.rs18
7 files changed, 3 insertions, 54 deletions
diff --git a/src/libstd/bool.rs b/src/libstd/bool.rs
index eeaea6a2cff..598e8080618 100644
--- a/src/libstd/bool.rs
+++ b/src/libstd/bool.rs
@@ -284,12 +284,6 @@ impl Not<bool> for bool {
 impl Ord for bool {
     #[inline]
     fn lt(&self, other: &bool) -> bool { to_bit(*self) < to_bit(*other) }
-    #[inline]
-    fn le(&self, other: &bool) -> bool { to_bit(*self) <= to_bit(*other) }
-    #[inline]
-    fn gt(&self, other: &bool) -> bool { to_bit(*self) > to_bit(*other) }
-    #[inline]
-    fn ge(&self, other: &bool) -> bool { to_bit(*self) >= to_bit(*other) }
 }
 
 #[cfg(not(test))]
diff --git a/src/libstd/char.rs b/src/libstd/char.rs
index 85053855432..9c55e22b1f8 100644
--- a/src/libstd/char.rs
+++ b/src/libstd/char.rs
@@ -322,12 +322,6 @@ impl Eq for char {
 impl Ord for char {
     #[inline]
     fn lt(&self, other: &char) -> bool { *self < *other }
-    #[inline]
-    fn le(&self, other: &char) -> bool { *self <= *other }
-    #[inline]
-    fn gt(&self, other: &char) -> bool { *self > *other }
-    #[inline]
-    fn ge(&self, other: &char) -> bool { *self >= *other }
 }
 
 #[cfg(not(test))]
diff --git a/src/libstd/cmp.rs b/src/libstd/cmp.rs
index b66f89e8341..28d45abb688 100644
--- a/src/libstd/cmp.rs
+++ b/src/libstd/cmp.rs
@@ -101,12 +101,6 @@ impl TotalOrd for Ordering {
 impl Ord for Ordering {
     #[inline]
     fn lt(&self, other: &Ordering) -> bool { (*self as int) < (*other as int) }
-    #[inline]
-    fn le(&self, other: &Ordering) -> bool { (*self as int) <= (*other as int) }
-    #[inline]
-    fn gt(&self, other: &Ordering) -> bool { (*self as int) > (*other as int) }
-    #[inline]
-    fn ge(&self, other: &Ordering) -> bool { (*self as int) >= (*other as int) }
 }
 
 macro_rules! totalord_impl(
@@ -174,8 +168,11 @@ pub fn lexical_ordering(o1: Ordering, o2: Ordering) -> Ordering {
 #[lang="ord"]
 pub trait Ord {
     fn lt(&self, other: &Self) -> bool;
+    #[inline]
     fn le(&self, other: &Self) -> bool { !other.lt(self) }
+    #[inline]
     fn gt(&self, other: &Self) -> bool {  other.lt(self) }
+    #[inline]
     fn ge(&self, other: &Self) -> bool { !self.lt(other) }
 }
 
diff --git a/src/libstd/nil.rs b/src/libstd/nil.rs
index 81b7662e581..3507dc9d2b2 100644
--- a/src/libstd/nil.rs
+++ b/src/libstd/nil.rs
@@ -33,12 +33,6 @@ impl Eq for () {
 impl Ord for () {
     #[inline]
     fn lt(&self, _other: &()) -> bool { false }
-    #[inline]
-    fn le(&self, _other: &()) -> bool { true }
-    #[inline]
-    fn ge(&self, _other: &()) -> bool { true }
-    #[inline]
-    fn gt(&self, _other: &()) -> bool { false }
 }
 
 #[cfg(not(test))]
diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs
index b692bedebfd..41da9a6ccbe 100644
--- a/src/libstd/num/int_macros.rs
+++ b/src/libstd/num/int_macros.rs
@@ -130,12 +130,6 @@ impl Num for $T {}
 impl Ord for $T {
     #[inline]
     fn lt(&self, other: &$T) -> bool { return (*self) < (*other); }
-    #[inline]
-    fn le(&self, other: &$T) -> bool { return (*self) <= (*other); }
-    #[inline]
-    fn ge(&self, other: &$T) -> bool { return (*self) >= (*other); }
-    #[inline]
-    fn gt(&self, other: &$T) -> bool { return (*self) > (*other); }
 }
 
 #[cfg(not(test))]
diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs
index 29b8f29d87d..86b5b4ddfc0 100644
--- a/src/libstd/num/uint_macros.rs
+++ b/src/libstd/num/uint_macros.rs
@@ -131,12 +131,6 @@ impl Num for $T {}
 impl Ord for $T {
     #[inline]
     fn lt(&self, other: &$T) -> bool { (*self) < (*other) }
-    #[inline]
-    fn le(&self, other: &$T) -> bool { (*self) <= (*other) }
-    #[inline]
-    fn ge(&self, other: &$T) -> bool { (*self) >= (*other) }
-    #[inline]
-    fn gt(&self, other: &$T) -> bool { (*self) > (*other) }
 }
 
 #[cfg(not(test))]
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index fa75916fb86..430eb8544f6 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -1050,34 +1050,16 @@ pub mod traits {
     impl<'self> Ord for &'self str {
         #[inline]
         fn lt(&self, other: & &'self str) -> bool { self.cmp(other) == Less }
-        #[inline]
-        fn le(&self, other: & &'self str) -> bool { self.cmp(other) != Greater }
-        #[inline]
-        fn ge(&self, other: & &'self str) -> bool { self.cmp(other) != Less }
-        #[inline]
-        fn gt(&self, other: & &'self str) -> bool { self.cmp(other) == Greater }
     }
 
     impl Ord for ~str {
         #[inline]
         fn lt(&self, other: &~str) -> bool { self.cmp(other) == Less }
-        #[inline]
-        fn le(&self, other: &~str) -> bool { self.cmp(other) != Greater }
-        #[inline]
-        fn ge(&self, other: &~str) -> bool { self.cmp(other) != Less }
-        #[inline]
-        fn gt(&self, other: &~str) -> bool { self.cmp(other) == Greater }
     }
 
     impl Ord for @str {
         #[inline]
         fn lt(&self, other: &@str) -> bool { self.cmp(other) == Less }
-        #[inline]
-        fn le(&self, other: &@str) -> bool { self.cmp(other) != Greater }
-        #[inline]
-        fn ge(&self, other: &@str) -> bool { self.cmp(other) != Less }
-        #[inline]
-        fn gt(&self, other: &@str) -> bool { self.cmp(other) == Greater }
     }
 
     impl<'self, S: Str> Equiv<S> for &'self str {