@@ -901,7 +901,7 @@ impl<'self> Formatter<'self> {
901
901
// case where the maximum length will matter.
902
902
let char_len = s. char_len ( ) ;
903
903
if char_len >= max {
904
- let nchars = :: uint :: min ( max, char_len) ;
904
+ let nchars = :: cmp :: min ( max, char_len) ;
905
905
self . buf . write ( s. slice_chars ( 0 , nchars) . as_bytes ( ) ) ;
906
906
return
907
907
}
@@ -1036,31 +1036,26 @@ pub fn upperhex(buf: &[u8], f: &mut Formatter) {
1036
1036
f. pad_integral ( local. slice_to ( buf. len ( ) ) , "0x" , true ) ;
1037
1037
}
1038
1038
1039
- // FIXME(#4375) shouldn't need an inner module
1040
1039
macro_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
+ } )
1052
1047
}
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)
1063
1048
}
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)
1064
1059
} )
1065
1060
1066
1061
integer ! ( int, uint)
0 commit comments