Skip to content

Commit 429d38d

Browse files
committed
---
yaml --- r: 60462 b: refs/heads/auto c: ad6ee5f h: refs/heads/master v: v3
1 parent 1741a7a commit 429d38d

File tree

4 files changed

+96
-81
lines changed

4 files changed

+96
-81
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: 60ea6d6957697ac6ced355e8a1db5ab6be439765
17+
refs/heads/auto: ad6ee5f4e5f779d987ac7a35ce6f149039a45b15
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/either.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ pub enum Either<T, U> {
3535
pub fn either<T, U, V>(f_left: &fn(&T) -> V,
3636
f_right: &fn(&U) -> V, value: &Either<T, U>) -> V {
3737
match *value {
38-
Left(ref l) => f_left(l),
39-
Right(ref r) => f_right(r)
38+
Left(ref l) => f_left(l),
39+
Right(ref r) => f_right(r)
4040
}
4141
}
4242

@@ -73,8 +73,8 @@ pub fn partition<T, U>(eithers: ~[Either<T, U>]) -> (~[T], ~[U]) {
7373
let mut rights: ~[U] = ~[];
7474
do vec::consume(eithers) |_i, elt| {
7575
match elt {
76-
Left(l) => lefts.push(l),
77-
Right(r) => rights.push(r)
76+
Left(l) => lefts.push(l),
77+
Right(r) => rights.push(r)
7878
}
7979
}
8080
return (lefts, rights);
@@ -84,8 +84,8 @@ pub fn partition<T, U>(eithers: ~[Either<T, U>]) -> (~[T], ~[U]) {
8484
#[inline(always)]
8585
pub fn flip<T, U>(eith: Either<T, U>) -> Either<U, T> {
8686
match eith {
87-
Right(r) => Left(r),
88-
Left(l) => Right(l)
87+
Right(r) => Left(r),
88+
Left(l) => Right(l)
8989
}
9090
}
9191

@@ -96,21 +96,27 @@ pub fn flip<T, U>(eith: Either<T, U>) -> Either<U, T> {
9696
#[inline(always)]
9797
pub fn to_result<T, U>(eith: Either<T, U>) -> Result<U, T> {
9898
match eith {
99-
Right(r) => result::Ok(r),
100-
Left(l) => result::Err(l)
99+
Right(r) => result::Ok(r),
100+
Left(l) => result::Err(l)
101101
}
102102
}
103103

104104
/// Checks whether the given value is a left
105105
#[inline(always)]
106106
pub fn is_left<T, U>(eith: &Either<T, U>) -> bool {
107-
match *eith { Left(_) => true, _ => false }
107+
match *eith {
108+
Left(_) => true,
109+
_ => false
110+
}
108111
}
109112

110113
/// Checks whether the given value is a right
111114
#[inline(always)]
112115
pub fn is_right<T, U>(eith: &Either<T, U>) -> bool {
113-
match *eith { Right(_) => true, _ => false }
116+
match *eith {
117+
Right(_) => true,
118+
_ => false
119+
}
114120
}
115121

116122
/// Retrieves the value in the left branch. Fails if the either is Right.

branches/auto/src/libcore/option.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ impl<T:Ord> Ord for Option<T> {
8989
}
9090

9191
fn ge(&self, other: &Option<T>) -> bool {
92-
! (self < other)
92+
!(self < other)
9393
}
9494

9595
fn gt(&self, other: &Option<T>) -> bool {
96-
! (self <= other)
96+
!(self <= other)
9797
}
9898
}
9999

0 commit comments

Comments
 (0)