File tree 8 files changed +3
-57
lines changed
8 files changed +3
-57
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,6 @@ impl Ord for Timespec {
57
57
self . sec < other. sec ||
58
58
( self . sec == other. sec && self . nsec < other. nsec )
59
59
}
60
- fn le ( & self , other : & Timespec ) -> bool { !other. lt ( self ) }
61
- fn ge ( & self , other : & Timespec ) -> bool { !self . lt ( other) }
62
- fn gt ( & self , other : & Timespec ) -> bool { !self . le ( other) }
63
60
}
64
61
65
62
/**
Original file line number Diff line number Diff line change @@ -284,12 +284,6 @@ impl Not<bool> for bool {
284
284
impl Ord for bool {
285
285
#[ inline]
286
286
fn lt ( & self , other : & bool ) -> bool { to_bit ( * self ) < to_bit ( * other) }
287
- #[ inline]
288
- fn le ( & self , other : & bool ) -> bool { to_bit ( * self ) <= to_bit ( * other) }
289
- #[ inline]
290
- fn gt ( & self , other : & bool ) -> bool { to_bit ( * self ) > to_bit ( * other) }
291
- #[ inline]
292
- fn ge ( & self , other : & bool ) -> bool { to_bit ( * self ) >= to_bit ( * other) }
293
287
}
294
288
295
289
#[ cfg( not( test) ) ]
Original file line number Diff line number Diff line change @@ -322,12 +322,6 @@ impl Eq for char {
322
322
impl Ord for char {
323
323
#[ inline]
324
324
fn lt ( & self , other : & char ) -> bool { * self < * other }
325
- #[ inline]
326
- fn le ( & self , other : & char ) -> bool { * self <= * other }
327
- #[ inline]
328
- fn gt ( & self , other : & char ) -> bool { * self > * other }
329
- #[ inline]
330
- fn ge ( & self , other : & char ) -> bool { * self >= * other }
331
325
}
332
326
333
327
#[ cfg( not( test) ) ]
Original file line number Diff line number Diff line change @@ -101,12 +101,6 @@ impl TotalOrd for Ordering {
101
101
impl Ord for Ordering {
102
102
#[ inline]
103
103
fn lt ( & self , other : & Ordering ) -> bool { ( * self as int ) < ( * other as int ) }
104
- #[ inline]
105
- fn le ( & self , other : & Ordering ) -> bool { ( * self as int ) <= ( * other as int ) }
106
- #[ inline]
107
- fn gt ( & self , other : & Ordering ) -> bool { ( * self as int ) > ( * other as int ) }
108
- #[ inline]
109
- fn ge ( & self , other : & Ordering ) -> bool { ( * self as int ) >= ( * other as int ) }
110
104
}
111
105
112
106
macro_rules! totalord_impl(
@@ -174,8 +168,11 @@ pub fn lexical_ordering(o1: Ordering, o2: Ordering) -> Ordering {
174
168
#[ lang="ord" ]
175
169
pub trait Ord {
176
170
fn lt ( & self , other : & Self ) -> bool ;
171
+ #[ inline]
177
172
fn le ( & self , other : & Self ) -> bool { !other. lt ( self ) }
173
+ #[ inline]
178
174
fn gt ( & self , other : & Self ) -> bool { other. lt ( self ) }
175
+ #[ inline]
179
176
fn ge ( & self , other : & Self ) -> bool { !self . lt ( other) }
180
177
}
181
178
Original file line number Diff line number Diff line change @@ -33,12 +33,6 @@ impl Eq for () {
33
33
impl Ord for ( ) {
34
34
#[ inline]
35
35
fn lt ( & self , _other : & ( ) ) -> bool { false }
36
- #[ inline]
37
- fn le ( & self , _other : & ( ) ) -> bool { true }
38
- #[ inline]
39
- fn ge ( & self , _other : & ( ) ) -> bool { true }
40
- #[ inline]
41
- fn gt ( & self , _other : & ( ) ) -> bool { false }
42
36
}
43
37
44
38
#[ cfg( not( test) ) ]
Original file line number Diff line number Diff line change @@ -130,12 +130,6 @@ impl Num for $T {}
130
130
impl Ord for $T {
131
131
#[inline]
132
132
fn lt(&self, other: &$T) -> bool { return (*self) < (*other); }
133
- #[inline]
134
- fn le(&self, other: &$T) -> bool { return (*self) <= (*other); }
135
- #[inline]
136
- fn ge(&self, other: &$T) -> bool { return (*self) >= (*other); }
137
- #[inline]
138
- fn gt(&self, other: &$T) -> bool { return (*self) > (*other); }
139
133
}
140
134
141
135
#[cfg(not(test))]
Original file line number Diff line number Diff line change @@ -131,12 +131,6 @@ impl Num for $T {}
131
131
impl Ord for $T {
132
132
#[ inline]
133
133
fn lt( & self , other: & $T) -> bool { ( * self ) < ( * other) }
134
- #[ inline]
135
- fn le( & self , other: & $T) -> bool { ( * self ) <= ( * other) }
136
- #[ inline]
137
- fn ge( & self , other: & $T) -> bool { ( * self ) >= ( * other) }
138
- #[ inline]
139
- fn gt( & self , other: & $T) -> bool { ( * self ) > ( * other) }
140
134
}
141
135
142
136
#[ cfg( not( test) ) ]
Original file line number Diff line number Diff line change @@ -1050,34 +1050,16 @@ pub mod traits {
1050
1050
impl<'self> Ord for &'self str {
1051
1051
#[inline]
1052
1052
fn lt(&self, other: & &'self str) -> bool { self.cmp(other) == Less }
1053
- #[inline]
1054
- fn le(&self, other: & &'self str) -> bool { self.cmp(other) != Greater }
1055
- #[inline]
1056
- fn ge(&self, other: & &'self str) -> bool { self.cmp(other) != Less }
1057
- #[inline]
1058
- fn gt(&self, other: & &'self str) -> bool { self.cmp(other) == Greater }
1059
1053
}
1060
1054
1061
1055
impl Ord for ~str {
1062
1056
#[inline]
1063
1057
fn lt(&self, other: &~str) -> bool { self.cmp(other) == Less }
1064
- #[inline]
1065
- fn le(&self, other: &~str) -> bool { self.cmp(other) != Greater }
1066
- #[inline]
1067
- fn ge(&self, other: &~str) -> bool { self.cmp(other) != Less }
1068
- #[inline]
1069
- fn gt(&self, other: &~str) -> bool { self.cmp(other) == Greater }
1070
1058
}
1071
1059
1072
1060
impl Ord for @str {
1073
1061
#[inline]
1074
1062
fn lt(&self, other: &@str) -> bool { self.cmp(other) == Less }
1075
- #[inline]
1076
- fn le(&self, other: &@str) -> bool { self.cmp(other) != Greater }
1077
- #[inline]
1078
- fn ge(&self, other: &@str) -> bool { self.cmp(other) != Less }
1079
- #[inline]
1080
- fn gt(&self, other: &@str) -> bool { self.cmp(other) == Greater }
1081
1063
}
1082
1064
1083
1065
impl<'self, S: Str> Equiv<S> for &'self str {
You can’t perform that action at this time.
0 commit comments