Skip to content

Commit 2fee220

Browse files
committed
---
yaml --- r: 55956 b: refs/heads/auto c: 5641777 h: refs/heads/master v: v3
1 parent 2b875d1 commit 2fee220

File tree

3 files changed

+190
-172
lines changed

3 files changed

+190
-172
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: a3f40184bdc0d094ac76b15f66bfbf87a699a705
17+
refs/heads/auto: 5641777318239926363207f690bf265f7514a63c
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/cmp.rs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,32 +64,14 @@ totaleq_impl!(i64)
6464
totaleq_impl!(int)
6565
totaleq_impl!(uint)
6666

67-
#[deriving(Clone, Eq)]
68-
pub enum Ordering { Less = -1, Equal = 0, Greater = 1 }
67+
#[deriving(Eq)]
68+
pub enum Ordering { Less, Equal, Greater }
6969

7070
/// Trait for types that form a total order
7171
pub trait TotalOrd: TotalEq {
7272
fn cmp(&self, other: &Self) -> Ordering;
7373
}
7474

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-
9375
macro_rules! totalord_impl(
9476
($t:ty) => {
9577
impl TotalOrd for $t {
@@ -198,10 +180,4 @@ mod test {
198180
assert!(5.equals(&5));
199181
assert!(!2.equals(&17));
200182
}
201-
202-
#[test]
203-
fn test_ordering_order() {
204-
assert!(Less < Equal);
205-
assert_eq!(Greater.cmp(&Less), Greater);
206-
}
207183
}

0 commit comments

Comments
 (0)