@@ -320,8 +320,8 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
320
320
Some ( ( value, pos) )
321
321
}
322
322
323
- fn match_digits_in_range ( ss : & str , pos : uint , digits : uint , ws : bool , min : i32 , max : i32 )
324
- -> Option < ( i32 , uint ) > {
323
+ fn match_digits_in_range ( ss : & str , pos : uint , digits : uint , ws : bool ,
324
+ min : i32 , max : i32 ) -> Option < ( i32 , uint ) > {
325
325
match match_digits ( ss, pos, digits, ws) {
326
326
Some ( ( val, pos) ) if val >= min && val <= max => {
327
327
Some ( ( val, pos) )
@@ -403,7 +403,8 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
403
403
Some ( item) => { let ( v, pos) = item; tm. tm_mon = v; Ok ( pos) }
404
404
None => Err ( ~"Invalid month")
405
405
} ,
406
- 'C' => match match_digits_in_range ( s, pos, 2 u, false , 0_i32 , 99_i32 ) {
406
+ 'C' => match match_digits_in_range ( s, pos, 2 u, false , 0_i32 ,
407
+ 99_i32 ) {
407
408
Some ( item) => {
408
409
let ( v, pos) = item;
409
410
tm. tm_year += ( v * 100_i32 ) - 1900_i32 ;
@@ -429,11 +430,13 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
429
430
. chain ( |pos| parse_char ( s, pos, '/' ) )
430
431
. chain ( |pos| parse_type ( s, pos, 'y' , tm) )
431
432
}
432
- 'd' => match match_digits_in_range ( s, pos, 2 u, false , 1_i32 , 31_i32 ) {
433
+ 'd' => match match_digits_in_range ( s, pos, 2 u, false , 1_i32 ,
434
+ 31_i32 ) {
433
435
Some ( item) => { let ( v, pos) = item; tm. tm_mday = v; Ok ( pos) }
434
436
None => Err ( ~"Invalid day of the month")
435
437
} ,
436
- 'e' => match match_digits_in_range ( s, pos, 2 u, true , 1_i32 , 31_i32 ) {
438
+ 'e' => match match_digits_in_range ( s, pos, 2 u, true , 1_i32 ,
439
+ 31_i32 ) {
437
440
Some ( item) => { let ( v, pos) = item; tm. tm_mday = v; Ok ( pos) }
438
441
None => Err ( ~"Invalid day of the month")
439
442
} ,
0 commit comments