File tree Expand file tree Collapse file tree 3 files changed +190
-172
lines changed Expand file tree Collapse file tree 3 files changed +190
-172
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5
- refs/heads/try: a3f40184bdc0d094ac76b15f66bfbf87a699a705
5
+ refs/heads/try: 5641777318239926363207f690bf265f7514a63c
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
Original file line number Diff line number Diff line change @@ -64,32 +64,14 @@ totaleq_impl!(i64)
64
64
totaleq_impl ! ( int)
65
65
totaleq_impl ! ( uint)
66
66
67
- #[ deriving( Clone , Eq ) ]
68
- pub enum Ordering { Less = - 1 , Equal = 0 , Greater = 1 }
67
+ #[ deriving( Eq ) ]
68
+ pub enum Ordering { Less , Equal , Greater }
69
69
70
70
/// Trait for types that form a total order
71
71
pub trait TotalOrd : TotalEq {
72
72
fn cmp ( & self , other : & Self ) -> Ordering ;
73
73
}
74
74
75
- impl TotalOrd for Ordering {
76
- #[ inline( always) ]
77
- fn cmp ( & self , other : & Ordering ) -> Ordering {
78
- ( * self as int ) . cmp ( & ( * other as int ) )
79
- }
80
- }
81
-
82
- impl Ord for Ordering {
83
- #[ inline( always) ]
84
- fn lt ( & self , other : & Ordering ) -> bool { ( * self as int ) < ( * other as int ) }
85
- #[ inline( always) ]
86
- fn le ( & self , other : & Ordering ) -> bool { ( * self as int ) <= ( * other as int ) }
87
- #[ inline( always) ]
88
- fn gt ( & self , other : & Ordering ) -> bool { ( * self as int ) > ( * other as int ) }
89
- #[ inline( always) ]
90
- fn ge ( & self , other : & Ordering ) -> bool { ( * self as int ) >= ( * other as int ) }
91
- }
92
-
93
75
macro_rules! totalord_impl(
94
76
( $t: ty) => {
95
77
impl TotalOrd for $t {
@@ -198,10 +180,4 @@ mod test {
198
180
assert ! ( 5 . equals( & 5 ) ) ;
199
181
assert ! ( !2 . equals( & 17 ) ) ;
200
182
}
201
-
202
- #[ test]
203
- fn test_ordering_order ( ) {
204
- assert ! ( Less < Equal ) ;
205
- assert_eq ! ( Greater . cmp( & Less ) , Greater ) ;
206
- }
207
183
}
You can’t perform that action at this time.
0 commit comments