@@ -286,13 +286,11 @@ impl<'a> Iterator for Parser<'a> {
286
286
lbrace_byte_pos. to ( InnerOffset ( rbrace_byte_pos. 0 + width) ) ,
287
287
) ;
288
288
}
289
- } else {
290
- if let Some ( & ( _, maybe) ) = self . cur . peek ( ) {
291
- match maybe {
292
- '?' => self . suggest_format_debug ( ) ,
293
- '<' | '^' | '>' => self . suggest_format_align ( maybe) ,
294
- _ => self . suggest_positional_arg_instead_of_captured_arg ( arg) ,
295
- }
289
+ } else if let Some ( & ( _, maybe) ) = self . cur . peek ( ) {
290
+ match maybe {
291
+ '?' => self . suggest_format_debug ( ) ,
292
+ '<' | '^' | '>' => self . suggest_format_align ( maybe) ,
293
+ _ => self . suggest_positional_arg_instead_of_captured_arg ( arg) ,
296
294
}
297
295
}
298
296
Some ( NextArgument ( Box :: new ( arg) ) )
@@ -1028,7 +1026,7 @@ fn find_width_map_from_snippet(
1028
1026
if next_c == '{' {
1029
1027
// consume up to 6 hexanumeric chars
1030
1028
let digits_len =
1031
- s. clone ( ) . take ( 6 ) . take_while ( |( _, c) | c. is_digit ( 16 ) ) . count ( ) ;
1029
+ s. clone ( ) . take ( 6 ) . take_while ( |( _, c) | c. is_ascii_hexdigit ( ) ) . count ( ) ;
1032
1030
1033
1031
let len_utf8 = s
1034
1032
. as_str ( )
@@ -1047,14 +1045,14 @@ fn find_width_map_from_snippet(
1047
1045
width += required_skips + 2 ;
1048
1046
1049
1047
s. nth ( digits_len) ;
1050
- } else if next_c. is_digit ( 16 ) {
1048
+ } else if next_c. is_ascii_hexdigit ( ) {
1051
1049
width += 1 ;
1052
1050
1053
1051
// We suggest adding `{` and `}` when appropriate, accept it here as if
1054
1052
// it were correct
1055
1053
let mut i = 0 ; // consume up to 6 hexanumeric chars
1056
1054
while let ( Some ( ( _, c) ) , _) = ( s. next ( ) , i < 6 ) {
1057
- if c. is_digit ( 16 ) {
1055
+ if c. is_ascii_hexdigit ( ) {
1058
1056
width += 1 ;
1059
1057
} else {
1060
1058
break ;
0 commit comments