Skip to content

Commit 1aab9dc

Browse files
committed
---
yaml --- r: 83149 b: refs/heads/auto c: 6969e5f h: refs/heads/master i: 83147: 45dc75d v: v3
1 parent 026f980 commit 1aab9dc

File tree

3 files changed

+10
-51
lines changed

3 files changed

+10
-51
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: abecd61a230d7057aeb1dc6d82e3c8101c7d9337
16+
refs/heads/auto: 6969e5fb587dff4798386b1386661920b71e9f00
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/target.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export CFG_COMPILER_TRIPLE
1515

1616
# The standard libraries should be held up to a higher standard than any old
1717
# code, make sure that these common warnings are denied by default. These can
18-
# be overridden during development temporarily. For stage0, we allow all these
19-
# to suppress warnings which may be bugs in stage0 (should be fixed in stage1+)
20-
WFLAGS_ST0 = -A warnings
18+
# be overridden during development temporarily. For stage0, we allow warnings
19+
# which may be bugs in stage0 (should be fixed in stage1+)
20+
WFLAGS_ST0 = -W warnings
2121
WFLAGS_ST1 = -D warnings
2222
WFLAGS_ST2 = -D warnings
2323

branches/auto/src/libstd/result.rs

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use vec;
2222
use vec::OwnedVector;
2323
use to_str::ToStr;
2424
use str::StrSlice;
25-
use fmt;
2625

2726
/// `Result` is a type that represents either success (`Ok`) or failure (`Err`).
2827
///
@@ -291,7 +290,7 @@ pub trait AsResult<T, E> {
291290

292291
impl<T: Clone, E> option::ToOption<T> for Result<T, E> {
293292
#[inline]
294-
fn to_option(&self) -> Option<T> {
293+
fn to_option(&self)-> Option<T> {
295294
match *self {
296295
Ok(ref t) => Some(t.clone()),
297296
Err(_) => None,
@@ -301,7 +300,7 @@ impl<T: Clone, E> option::ToOption<T> for Result<T, E> {
301300

302301
impl<T, E> option::IntoOption<T> for Result<T, E> {
303302
#[inline]
304-
fn into_option(self) -> Option<T> {
303+
fn into_option(self)-> Option<T> {
305304
match self {
306305
Ok(t) => Some(t),
307306
Err(_) => None,
@@ -311,7 +310,7 @@ impl<T, E> option::IntoOption<T> for Result<T, E> {
311310

312311
impl<T, E> option::AsOption<T> for Result<T, E> {
313312
#[inline]
314-
fn as_option<'a>(&'a self) -> Option<&'a T> {
313+
fn as_option<'a>(&'a self)-> Option<&'a T> {
315314
match *self {
316315
Ok(ref t) => Some(t),
317316
Err(_) => None,
@@ -341,7 +340,7 @@ impl<T, E> AsResult<T, E> for Result<T, E> {
341340

342341
impl<T: Clone, E: Clone> either::ToEither<E, T> for Result<T, E> {
343342
#[inline]
344-
fn to_either(&self) -> either::Either<E, T> {
343+
fn to_either(&self)-> either::Either<E, T> {
345344
match *self {
346345
Ok(ref t) => either::Right(t.clone()),
347346
Err(ref e) => either::Left(e.clone()),
@@ -351,7 +350,7 @@ impl<T: Clone, E: Clone> either::ToEither<E, T> for Result<T, E> {
351350

352351
impl<T, E> either::IntoEither<E, T> for Result<T, E> {
353352
#[inline]
354-
fn into_either(self) -> either::Either<E, T> {
353+
fn into_either(self)-> either::Either<E, T> {
355354
match self {
356355
Ok(t) => either::Right(t),
357356
Err(e) => either::Left(e),
@@ -361,34 +360,14 @@ impl<T, E> either::IntoEither<E, T> for Result<T, E> {
361360

362361
impl<T, E> either::AsEither<E, T> for Result<T, E> {
363362
#[inline]
364-
fn as_either<'a>(&'a self) -> either::Either<&'a E, &'a T> {
363+
fn as_either<'a>(&'a self)-> either::Either<&'a E, &'a T> {
365364
match *self {
366365
Ok(ref t) => either::Right(t),
367366
Err(ref e) => either::Left(e),
368367
}
369368
}
370369
}
371370

372-
impl<T: ToStr, E: ToStr> ToStr for Result<T, E> {
373-
#[inline]
374-
fn to_str(&self) -> ~str {
375-
match *self {
376-
Ok(ref t) => format!("Ok({:s})", t.to_str()),
377-
Err(ref e) => format!("Err({:s})", e.to_str())
378-
}
379-
}
380-
}
381-
382-
impl<T: fmt::Default, E: fmt::Default> fmt::Default for Result<T, E> {
383-
#[inline]
384-
fn fmt(s: &Result<T, E>, f: &mut fmt::Formatter) {
385-
match *s {
386-
Ok(ref t) => write!(f.buf, "Ok({})", *t),
387-
Err(ref e) => write!(f.buf, "Err({})", *e)
388-
}
389-
}
390-
}
391-
392371
/// Takes each element in the iterator: if it is an error, no further
393372
/// elements are taken, and the error is returned.
394373
/// Should no error occur, a vector containing the values of each Result
@@ -462,8 +441,6 @@ mod tests {
462441
use option;
463442
use str::OwnedStr;
464443
use vec::ImmutableVector;
465-
use to_str::ToStr;
466-
use fmt::Default;
467444

468445
pub fn op1() -> Result<int, ~str> { Ok(666) }
469446
pub fn op2() -> Result<int, ~str> { Err(~"sadface") }
@@ -682,22 +659,4 @@ mod tests {
682659
assert_eq!(ok.as_either().unwrap_right(), &100);
683660
assert_eq!(err.as_either().unwrap_left(), &404);
684661
}
685-
686-
#[test]
687-
pub fn test_to_str() {
688-
let ok: Result<int, ~str> = Ok(100);
689-
let err: Result<int, ~str> = Err(~"Err");
690-
691-
assert_eq!(ok.to_str(), ~"Ok(100)");
692-
assert_eq!(err.to_str(), ~"Err(Err)");
693-
}
694-
695-
#[test]
696-
pub fn test_fmt_default() {
697-
let ok: Result<int, ~str> = Ok(100);
698-
let err: Result<int, ~str> = Err(~"Err");
699-
700-
assert_eq!(format!("{}", ok), ~"Ok(100)");
701-
assert_eq!(format!("{}", err), ~"Err(Err)");
702-
}
703662
}

0 commit comments

Comments
 (0)