@@ -258,7 +258,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
258258 ' ' => flags. space = true ,
259259 '.' => fstate = FormatStatePrecision ,
260260 '0' ..'9' => {
261- flags. width = ( cur - '0' ) as uint ;
261+ flags. width = ( cur as uint - '0' as uint ) ;
262262 fstate = FormatStateWidth ;
263263 }
264264 _ => util:: unreachable ( )
@@ -330,7 +330,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
330330 state = Nothing ;
331331 }
332332 '0' ..'9' => {
333- state = IntConstant ( i* 10 + ( ( cur - '0' ) as int ) ) ;
333+ state = IntConstant ( i* 10 + ( cur as int - '0' as int ) ) ;
334334 old_state = Nothing ;
335335 }
336336 _ => return Err ( ~"bad int constant")
@@ -358,23 +358,23 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
358358 flags. space = true ;
359359 }
360360 ( FormatStateFlags , '0' ..'9' ) => {
361- flags. width = ( cur - '0' ) as uint ;
361+ flags. width = ( cur as uint - '0' as uint ) ;
362362 * fstate = FormatStateWidth ;
363363 }
364364 ( FormatStateFlags , '.' ) => {
365365 * fstate = FormatStatePrecision ;
366366 }
367367 ( FormatStateWidth , '0' ..'9' ) => {
368368 let old = flags. width ;
369- flags. width = flags. width * 10 + ( ( cur - '0' ) as uint ) ;
369+ flags. width = flags. width * 10 + ( cur as uint - '0' as uint ) ;
370370 if flags. width < old { return Err ( ~"format width overflow") }
371371 }
372372 ( FormatStateWidth , '.' ) => {
373373 * fstate = FormatStatePrecision ;
374374 }
375375 ( FormatStatePrecision , '0' ..'9' ) => {
376376 let old = flags. precision ;
377- flags. precision = flags. precision * 10 + ( ( cur - '0' ) as uint ) ;
377+ flags. precision = flags. precision * 10 + ( cur as uint - '0' as uint ) ;
378378 if flags. precision < old { return Err ( ~"format precision overflow") }
379379 }
380380 _ => return Err ( ~"invalid format specifier")
0 commit comments