@@ -459,10 +459,9 @@ impl<'a> Tokenizer<'a> {
459459 "br" => ( true , true ) ,
460460 _ => {
461461 return Err ( Error :: new ( format_args ! (
462- "prefix {:?} \
462+ "prefix {prefix :?} \
463463 is not allowed for strings, \
464- allowed: `b`, `r`",
465- prefix
464+ allowed: `b`, `r`"
466465 ) ) )
467466 }
468467 } ;
@@ -471,10 +470,9 @@ impl<'a> Tokenizer<'a> {
471470 Some ( ( idx, '`' ) ) => {
472471 let prefix = & tail[ ..idx] ;
473472 return Err ( Error :: new ( format_args ! (
474- "prefix {:?} is not \
473+ "prefix {prefix :?} is not \
475474 allowed for field names, perhaps missing \
476- comma or dot?",
477- prefix
475+ comma or dot?"
478476 ) ) ) ;
479477 }
480478 Some ( ( _, c) ) if c == '_' || c. is_alphanumeric ( ) => continue ,
@@ -501,10 +499,9 @@ impl<'a> Tokenizer<'a> {
501499 Some ( ( _, '0' ..='9' ) ) => continue ,
502500 Some ( ( _, c) ) if c. is_alphabetic ( ) => {
503501 return Err ( Error :: new ( format_args ! (
504- "unexpected char {:?}, \
502+ "unexpected char {c :?}, \
505503 only integers are allowed after dot \
506- (for tuple access)",
507- c
504+ (for tuple access)"
508505 ) ) ) ;
509506 }
510507 Some ( ( idx, _) ) => break idx,
@@ -593,7 +590,7 @@ impl<'a> Tokenizer<'a> {
593590 return Err ( Error :: new ( "dollar quote supports only ascii chars" ) ) ;
594591 }
595592 if let Some ( end) =
596- find ( self . buf [ self . off + msize..] . as_bytes ( ) , marker. as_bytes ( ) )
593+ find ( & self . buf . as_bytes ( ) [ self . off + msize..] , marker. as_bytes ( ) )
597594 {
598595 let data = & self . buf [ self . off + msize..] [ ..end] ;
599596 for c in data. chars ( ) {
@@ -602,8 +599,7 @@ impl<'a> Tokenizer<'a> {
602599 return Ok ( ( Str , msize + end + msize) ) ;
603600 } else {
604601 return Err ( Error :: new ( format_args ! (
605- "unterminated string started with {:?}" ,
606- marker
602+ "unterminated string started with {marker:?}"
607603 ) ) ) ;
608604 }
609605 }
@@ -678,9 +674,8 @@ impl<'a> Tokenizer<'a> {
678674 c if c as u32 > 0x7f => {
679675 return Err ( Error :: new ( format_args ! (
680676 "invalid bytes literal: character \
681- {:?} is unexpected, only ascii chars are \
682- allowed in bytes literals",
683- c
677+ {c:?} is unexpected, only ascii chars are \
678+ allowed in bytes literals"
684679 ) ) ) ;
685680 }
686681 c if c == open_quote => return Ok ( ( Kind :: BinStr , quote_off + idx + 1 ) ) ,
@@ -702,8 +697,7 @@ impl<'a> Tokenizer<'a> {
702697 }
703698 }
704699 Err ( Error :: new ( format_args ! (
705- "unterminated string, quoted by `{}`" ,
706- open_quote
700+ "unterminated string, quoted by `{open_quote}`"
707701 ) ) )
708702 }
709703
@@ -726,8 +720,7 @@ impl<'a> Tokenizer<'a> {
726720 }
727721 }
728722 Err ( Error :: new ( format_args ! (
729- "unterminated string with interpolations, quoted by `{}`" ,
730- end,
723+ "unterminated string with interpolations, quoted by `{end}`" ,
731724 ) ) )
732725 }
733726
@@ -889,22 +882,19 @@ impl<'a> Tokenizer<'a> {
889882 } ;
890883 if suffix. starts_with ( 'O' ) {
891884 Err ( Error :: new ( format_args ! (
892- "suffix {:?} is invalid for \
885+ "suffix {suffix :?} is invalid for \
893886 numbers, perhaps mixed up letter `O` \
894- with zero `0`?",
895- suffix
887+ with zero `0`?"
896888 ) ) )
897889 } else if decimal {
898890 return Err ( Error :: new ( format_args ! (
899- "suffix {:?} is invalid for \
900- numbers, perhaps you wanted `{}n` (decimal)?",
901- suffix, val
891+ "suffix {suffix:?} is invalid for \
892+ numbers, perhaps you wanted `{val}n` (decimal)?"
902893 ) ) ) ;
903894 } else {
904895 return Err ( Error :: new ( format_args ! (
905- "suffix {:?} is invalid for \
906- numbers, perhaps you wanted `{}n` (bigint)?",
907- suffix, val
896+ "suffix {suffix:?} is invalid for \
897+ numbers, perhaps you wanted `{val}n` (bigint)?"
908898 ) ) ) ;
909899 }
910900 }
0 commit comments