Skip to content

Commit 8340de0

Browse files
committed
---
yaml --- r: 57201 b: refs/heads/try c: ad0b337 h: refs/heads/master i: 57199: 6400abd v: v3
1 parent d25b9e9 commit 8340de0

File tree

18 files changed

+1280
-427
lines changed

18 files changed

+1280
-427
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: 6d589f88f79a987de61fce00f0364b4199f50c22
5+
refs/heads/try: ad0b337036f2f9076852d5d6701ec302e3cce101
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libcore/char.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
//! Utilities for manipulating the char type
1212
13-
use cmp::Ord;
1413
use option::{None, Option, Some};
1514
use str;
1615
use u32;
@@ -244,26 +243,26 @@ pub fn len_utf8_bytes(c: char) -> uint {
244243
else { fail!(~"invalid character!") }
245244
}
246245
246+
/**
247+
* Compare two chars
248+
*
249+
* # Return value
250+
*
251+
* -1 if a < b, 0 if a == b, +1 if a > b
252+
*/
253+
#[inline(always)]
254+
pub fn cmp(a: char, b: char) -> int {
255+
return if b > a { -1 }
256+
else if b < a { 1 }
257+
else { 0 }
258+
}
259+
247260
#[cfg(notest)]
248261
impl Eq for char {
249-
#[inline(always)]
250262
fn eq(&self, other: &char) -> bool { (*self) == (*other) }
251-
#[inline(always)]
252263
fn ne(&self, other: &char) -> bool { (*self) != (*other) }
253264
}
254265
255-
#[cfg(notest)]
256-
impl Ord for char {
257-
#[inline(always)]
258-
fn lt(&self, other: &char) -> bool { *self < *other }
259-
#[inline(always)]
260-
fn le(&self, other: &char) -> bool { *self <= *other }
261-
#[inline(always)]
262-
fn gt(&self, other: &char) -> bool { *self > *other }
263-
#[inline(always)]
264-
fn ge(&self, other: &char) -> bool { *self >= *other }
265-
}
266-
267266
#[test]
268267
fn test_is_lowercase() {
269268
assert!(is_lowercase('a'));

branches/try/src/libcore/cmp.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ totaleq_impl!(i64)
6464
totaleq_impl!(int)
6565
totaleq_impl!(uint)
6666

67-
totaleq_impl!(char)
68-
6967
#[deriving(Clone, Eq)]
7068
pub enum Ordering { Less = -1, Equal = 0, Greater = 1 }
7169

@@ -118,8 +116,6 @@ totalord_impl!(i64)
118116
totalord_impl!(int)
119117
totalord_impl!(uint)
120118

121-
totalord_impl!(char)
122-
123119
pub fn cmp2<A:TotalOrd,B:TotalOrd>(
124120
a1: &A, b1: &B,
125121
a2: &A, b2: &B) -> Ordering

branches/try/src/libcore/core.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ pub use kinds::{Const, Copy, Owned, Durable};
7777
pub use ops::{Drop};
7878
#[cfg(stage0)]
7979
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
80-
#[cfg(stage1)]
81-
#[cfg(stage2)]
82-
#[cfg(stage3)]
80+
#[cfg(not(stage0))]
8381
pub use ops::{Add, Sub, Mul, Quot, Rem, Neg, Not};
8482
pub use ops::{BitAnd, BitOr, BitXor};
8583
pub use ops::{Shl, Shr, Index};
@@ -105,7 +103,9 @@ pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
105103
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
106104
pub use iter::{ExtendedMutableIter};
107105

108-
pub use num::{Num, Signed, Unsigned, Natural, NumCast};
106+
pub use num::{Num, NumCast};
107+
pub use num::{Signed, Unsigned, Integer};
108+
pub use num::{Round, Fractional, Real, RealExt};
109109
pub use ptr::Ptr;
110110
pub use to_str::ToStr;
111111
pub use clone::Clone;

0 commit comments

Comments
 (0)