@@ -1787,7 +1787,7 @@ impl<'h> Captures<'h> {
17871787 . expect ( "number of capture groups can vary in a match" )
17881788 . checked_sub ( 1 )
17891789 . expect ( "number of groups is always greater than zero" ) ;
1790- assert_eq ! ( N , len, "asked for {} groups, but must ask for {}" , N , len ) ;
1790+ assert_eq ! ( N , len, "asked for {N } groups, but must ask for {len}" ) ;
17911791 // The regex-automata variant of extract is a bit more permissive.
17921792 // It doesn't require the number of matching capturing groups to be
17931793 // static, and you can even request fewer groups than what's there. So
@@ -1942,7 +1942,7 @@ impl<'h> core::fmt::Debug for Captures<'h> {
19421942 fn fmt ( & self , f : & mut core:: fmt:: Formatter ) -> core:: fmt:: Result {
19431943 write ! ( f, "{}" , self . 0 ) ?;
19441944 if let Some ( name) = self . 1 {
1945- write ! ( f, "/{:?}" , name ) ?;
1945+ write ! ( f, "/{name :?}" ) ?;
19461946 }
19471947 Ok ( ( ) )
19481948 }
@@ -2646,7 +2646,7 @@ mod tests {
26462646 fn test_debug_output_valid_utf8 ( ) {
26472647 let haystack = b"Hello, world!" ;
26482648 let m = Match :: new ( haystack, 7 , 12 ) ;
2649- let debug_str = format ! ( "{:?}" , m ) ;
2649+ let debug_str = format ! ( "{m :?}" ) ;
26502650
26512651 assert_eq ! (
26522652 debug_str,
@@ -2658,7 +2658,7 @@ mod tests {
26582658 fn test_debug_output_invalid_utf8 ( ) {
26592659 let haystack = b"Hello, \xFF world!" ;
26602660 let m = Match :: new ( haystack, 7 , 13 ) ;
2661- let debug_str = format ! ( "{:?}" , m ) ;
2661+ let debug_str = format ! ( "{m :?}" ) ;
26622662
26632663 assert_eq ! (
26642664 debug_str,
@@ -2671,7 +2671,7 @@ mod tests {
26712671 let haystack =
26722672 "Hello, 😊 world! 안녕하세요? مرحبا بالعالم!" . as_bytes ( ) ;
26732673 let m = Match :: new ( haystack, 0 , haystack. len ( ) ) ;
2674- let debug_str = format ! ( "{:?}" , m ) ;
2674+ let debug_str = format ! ( "{m :?}" ) ;
26752675
26762676 assert_eq ! (
26772677 debug_str,
@@ -2683,7 +2683,7 @@ mod tests {
26832683 fn test_debug_output_ascii_escape ( ) {
26842684 let haystack = b"Hello,\t world!\n This is a \x1b [31mtest\x1b [0m." ;
26852685 let m = Match :: new ( haystack, 0 , haystack. len ( ) ) ;
2686- let debug_str = format ! ( "{:?}" , m ) ;
2686+ let debug_str = format ! ( "{m :?}" ) ;
26872687
26882688 assert_eq ! (
26892689 debug_str,
@@ -2695,7 +2695,7 @@ mod tests {
26952695 fn test_debug_output_match_in_middle ( ) {
26962696 let haystack = b"The quick brown fox jumps over the lazy dog." ;
26972697 let m = Match :: new ( haystack, 16 , 19 ) ;
2698- let debug_str = format ! ( "{:?}" , m ) ;
2698+ let debug_str = format ! ( "{m :?}" ) ;
26992699
27002700 assert_eq ! ( debug_str, r#"Match { start: 16, end: 19, bytes: "fox" }"# ) ;
27012701 }
0 commit comments