Skip to content

Commit 54ffe2c

Browse files
committed
---
yaml --- r: 51975 b: refs/heads/dist-snap c: 2fd8ebd h: refs/heads/master i: 51973: 195b193 51971: 6a4c53c 51967: d089c10 v: v3
1 parent c9e2bcd commit 54ffe2c

File tree

3 files changed

+82
-41
lines changed

3 files changed

+82
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: beec5193168e7fc71e0e6acded48c4bc3864eb5a
10+
refs/heads/dist-snap: 2fd8ebd03a9195bf7e2e3a811ec1dc0f1f2654db
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl<T, E> Result<T, E> {
234234
pure fn unwrap(self) -> T { unwrap(self) }
235235

236236
#[inline(always)]
237-
pure fn unwrap_err(self) -> E { unwrap_err(self) }
237+
pure fn unwrap_err(self) -> T { unwrap(self) }
238238

239239
#[inline(always)]
240240
pure fn chain<U>(self, op: fn(T) -> Result<U,E>) -> Result<U,E> {

branches/dist-snap/src/libstd/time.rs

Lines changed: 80 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -385,22 +385,36 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
385385
None => Err(~"Invalid year")
386386
},
387387
'c' => {
388-
parse_type(s, pos, 'a', tm)
389-
.chain(|pos| parse_char(s, pos, ' '))
390-
.chain(|pos| parse_type(s, pos, 'b', tm))
391-
.chain(|pos| parse_char(s, pos, ' '))
392-
.chain(|pos| parse_type(s, pos, 'e', tm))
393-
.chain(|pos| parse_char(s, pos, ' '))
394-
.chain(|pos| parse_type(s, pos, 'T', tm))
395-
.chain(|pos| parse_char(s, pos, ' '))
396-
.chain(|pos| parse_type(s, pos, 'Y', tm))
388+
// FIXME(#3724): cleanup
389+
result::chain(
390+
result::chain(
391+
result::chain(
392+
result::chain(
393+
result::chain(
394+
result::chain(
395+
result::chain(
396+
result::chain(
397+
move parse_type(s, pos, 'a', tm),
398+
|pos| parse_char(s, pos, ' ')),
399+
|pos| parse_type(s, pos, 'b', tm)),
400+
|pos| parse_char(s, pos, ' ')),
401+
|pos| parse_type(s, pos, 'e', tm)),
402+
|pos| parse_char(s, pos, ' ')),
403+
|pos| parse_type(s, pos, 'T', tm)),
404+
|pos| parse_char(s, pos, ' ')),
405+
|pos| parse_type(s, pos, 'Y', tm))
397406
}
398407
'D' | 'x' => {
399-
parse_type(s, pos, 'm', tm)
400-
.chain(|pos| parse_char(s, pos, '/'))
401-
.chain(|pos| parse_type(s, pos, 'd', tm))
402-
.chain(|pos| parse_char(s, pos, '/'))
403-
.chain(|pos| parse_type(s, pos, 'y', tm))
408+
// FIXME(#3724): cleanup
409+
result::chain(
410+
result::chain(
411+
result::chain(
412+
result::chain(
413+
move parse_type(s, pos, 'm', tm),
414+
|pos| parse_char(s, pos, '/')),
415+
|pos| parse_type(s, pos, 'd', tm)),
416+
|pos| parse_char(s, pos, '/')),
417+
|pos| parse_type(s, pos, 'y', tm))
404418
}
405419
'd' => match match_digits(s, pos, 2u, false) {
406420
Some(item) => { let (v, pos) = item; tm.tm_mday = v; Ok(pos) }
@@ -411,11 +425,16 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
411425
None => Err(~"Invalid day of the month")
412426
},
413427
'F' => {
414-
parse_type(s, pos, 'Y', tm)
415-
.chain(|pos| parse_char(s, pos, '-'))
416-
.chain(|pos| parse_type(s, pos, 'm', tm))
417-
.chain(|pos| parse_char(s, pos, '-'))
418-
.chain(|pos| parse_type(s, pos, 'd', tm))
428+
// FIXME(#3724): cleanup
429+
result::chain(
430+
result::chain(
431+
result::chain(
432+
result::chain(
433+
move parse_type(s, pos, 'Y', tm),
434+
|pos| parse_char(s, pos, '-')),
435+
|pos| parse_type(s, pos, 'm', tm)),
436+
|pos| parse_char(s, pos, '-')),
437+
|pos| parse_type(s, pos, 'd', tm))
419438
}
420439
'H' => {
421440
// FIXME (#2350): range check.
@@ -496,18 +515,28 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
496515
None => Err(~"Invalid hour")
497516
},
498517
'R' => {
499-
parse_type(s, pos, 'H', tm)
500-
.chain(|pos| parse_char(s, pos, ':'))
501-
.chain(|pos| parse_type(s, pos, 'M', tm))
518+
// FIXME(#3724): cleanup
519+
result::chain(
520+
result::chain(
521+
move parse_type(s, pos, 'H', tm),
522+
|pos| parse_char(s, pos, ':')),
523+
|pos| parse_type(s, pos, 'M', tm))
502524
}
503525
'r' => {
504-
parse_type(s, pos, 'I', tm)
505-
.chain(|pos| parse_char(s, pos, ':'))
506-
.chain(|pos| parse_type(s, pos, 'M', tm))
507-
.chain(|pos| parse_char(s, pos, ':'))
508-
.chain(|pos| parse_type(s, pos, 'S', tm))
509-
.chain(|pos| parse_char(s, pos, ' '))
510-
.chain(|pos| parse_type(s, pos, 'p', tm))
526+
// FIXME(#3724): cleanup
527+
result::chain(
528+
result::chain(
529+
result::chain(
530+
result::chain(
531+
result::chain(
532+
result::chain(
533+
move parse_type(s, pos, 'I', tm),
534+
|pos| parse_char(s, pos, ':')),
535+
|pos| parse_type(s, pos, 'M', tm)),
536+
|pos| parse_char(s, pos, ':')),
537+
|pos| parse_type(s, pos, 'S', tm)),
538+
|pos| parse_char(s, pos, ' ')),
539+
|pos| parse_type(s, pos, 'p', tm))
511540
}
512541
'S' => {
513542
// FIXME (#2350): range check.
@@ -522,11 +551,16 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
522551
}
523552
//'s' {}
524553
'T' | 'X' => {
525-
parse_type(s, pos, 'H', tm)
526-
.chain(|pos| parse_char(s, pos, ':'))
527-
.chain(|pos| parse_type(s, pos, 'M', tm))
528-
.chain(|pos| parse_char(s, pos, ':'))
529-
.chain(|pos| parse_type(s, pos, 'S', tm))
554+
// FIXME(#3724): cleanup
555+
result::chain(
556+
result::chain(
557+
result::chain(
558+
result::chain(
559+
move parse_type(s, pos, 'H', tm),
560+
|pos| parse_char(s, pos, ':')),
561+
|pos| parse_type(s, pos, 'M', tm)),
562+
|pos| parse_char(s, pos, ':')),
563+
|pos| parse_type(s, pos, 'S', tm))
530564
}
531565
't' => parse_char(s, pos, '\t'),
532566
'u' => {
@@ -541,11 +575,16 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
541575
}
542576
}
543577
'v' => {
544-
parse_type(s, pos, 'e', tm)
545-
.chain(|pos| parse_char(s, pos, '-'))
546-
.chain(|pos| parse_type(s, pos, 'b', tm))
547-
.chain(|pos| parse_char(s, pos, '-'))
548-
.chain(|pos| parse_type(s, pos, 'Y', tm))
578+
// FIXME(#3724): cleanup
579+
result::chain(
580+
result::chain(
581+
result::chain(
582+
result::chain(
583+
move parse_type(s, pos, 'e', tm),
584+
|pos| parse_char(s, pos, '-')),
585+
|pos| parse_type(s, pos, 'b', tm)),
586+
|pos| parse_char(s, pos, '-')),
587+
|pos| parse_type(s, pos, 'Y', tm))
549588
}
550589
//'W' {}
551590
'w' => {
@@ -1131,6 +1170,7 @@ mod tests {
11311170
}
11321171

11331172
#[test]
1173+
#[ignore(reason = "randomred")]
11341174
fn test_ctime() {
11351175
os::setenv(~"TZ", ~"America/Los_Angeles");
11361176
tzset();
@@ -1146,6 +1186,7 @@ mod tests {
11461186
}
11471187

11481188
#[test]
1189+
#[ignore(reason = "randomred")]
11491190
fn test_strftime() {
11501191
os::setenv(~"TZ", ~"America/Los_Angeles");
11511192
tzset();

0 commit comments

Comments
 (0)