@@ -286,13 +286,11 @@ impl<'a> Iterator for Parser<'a> {
286286 lbrace_byte_pos. to ( InnerOffset ( rbrace_byte_pos. 0 + width) ) ,
287287 ) ;
288288 }
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) ,
296294 }
297295 }
298296 Some ( NextArgument ( Box :: new ( arg) ) )
@@ -1028,7 +1026,7 @@ fn find_width_map_from_snippet(
10281026 if next_c == '{' {
10291027 // consume up to 6 hexanumeric chars
10301028 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 ( ) ;
10321030
10331031 let len_utf8 = s
10341032 . as_str ( )
@@ -1047,14 +1045,14 @@ fn find_width_map_from_snippet(
10471045 width += required_skips + 2 ;
10481046
10491047 s. nth ( digits_len) ;
1050- } else if next_c. is_digit ( 16 ) {
1048+ } else if next_c. is_ascii_hexdigit ( ) {
10511049 width += 1 ;
10521050
10531051 // We suggest adding `{` and `}` when appropriate, accept it here as if
10541052 // it were correct
10551053 let mut i = 0 ; // consume up to 6 hexanumeric chars
10561054 while let ( Some ( ( _, c) ) , _) = ( s. next ( ) , i < 6 ) {
1057- if c. is_digit ( 16 ) {
1055+ if c. is_ascii_hexdigit ( ) {
10581056 width += 1 ;
10591057 } else {
10601058 break ;
0 commit comments