@@ -901,7 +901,7 @@ impl<'self> Formatter<'self> {
901901 // case where the maximum length will matter.
902902 let char_len = s. char_len ( ) ;
903903 if char_len >= max {
904- let nchars = :: uint :: min ( max, char_len) ;
904+ let nchars = :: cmp :: min ( max, char_len) ;
905905 self . buf . write ( s. slice_chars ( 0 , nchars) . as_bytes ( ) ) ;
906906 return
907907 }
@@ -1036,31 +1036,26 @@ pub fn upperhex(buf: &[u8], f: &mut Formatter) {
10361036 f. pad_integral ( local. slice_to ( buf. len ( ) ) , "0x" , true ) ;
10371037}
10381038
1039- // FIXME(#4375) shouldn't need an inner module
10401039macro_rules! integer( ( $signed: ident, $unsigned: ident) => {
1041- mod $signed {
1042- use super :: * ;
1043-
1044- // Signed is special because it actuall emits the negative sign,
1045- // nothing else should do that, however.
1046- impl Signed for $signed {
1047- fn fmt( c: & $signed, f: & mut Formatter ) {
1048- :: $unsigned:: to_str_bytes( c. abs( ) as $unsigned, 10 , |buf| {
1049- f. pad_integral( buf, "" , * c >= 0 ) ;
1050- } )
1051- }
1040+ // Signed is special because it actuall emits the negative sign,
1041+ // nothing else should do that, however.
1042+ impl Signed for $signed {
1043+ fn fmt( c: & $signed, f: & mut Formatter ) {
1044+ :: $unsigned:: to_str_bytes( c. abs( ) as $unsigned, 10 , |buf| {
1045+ f. pad_integral( buf, "" , * c >= 0 ) ;
1046+ } )
10521047 }
1053- int_base!( $signed, $unsigned, 2 , Binary , "0b" )
1054- int_base!( $signed, $unsigned, 8 , Octal , "0o" )
1055- int_base!( $signed, $unsigned, 16 , LowerHex , "0x" )
1056- upper_hex!( $signed, $unsigned)
1057-
1058- int_base!( $unsigned, $unsigned, 2 , Binary , "0b" )
1059- int_base!( $unsigned, $unsigned, 8 , Octal , "0o" )
1060- int_base!( $unsigned, $unsigned, 10 , Unsigned , "" )
1061- int_base!( $unsigned, $unsigned, 16 , LowerHex , "0x" )
1062- upper_hex!( $unsigned, $unsigned)
10631048 }
1049+ int_base!( $signed, $unsigned, 2 , Binary , "0b" )
1050+ int_base!( $signed, $unsigned, 8 , Octal , "0o" )
1051+ int_base!( $signed, $unsigned, 16 , LowerHex , "0x" )
1052+ upper_hex!( $signed, $unsigned)
1053+
1054+ int_base!( $unsigned, $unsigned, 2 , Binary , "0b" )
1055+ int_base!( $unsigned, $unsigned, 8 , Octal , "0o" )
1056+ int_base!( $unsigned, $unsigned, 10 , Unsigned , "" )
1057+ int_base!( $unsigned, $unsigned, 16 , LowerHex , "0x" )
1058+ upper_hex!( $unsigned, $unsigned)
10641059} )
10651060
10661061integer ! ( int, uint)
0 commit comments