@@ -1787,7 +1787,7 @@ impl<'h> Captures<'h> {
1787
1787
. expect ( "number of capture groups can vary in a match" )
1788
1788
. checked_sub ( 1 )
1789
1789
. 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}" ) ;
1791
1791
// The regex-automata variant of extract is a bit more permissive.
1792
1792
// It doesn't require the number of matching capturing groups to be
1793
1793
// 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> {
1942
1942
fn fmt ( & self , f : & mut core:: fmt:: Formatter ) -> core:: fmt:: Result {
1943
1943
write ! ( f, "{}" , self . 0 ) ?;
1944
1944
if let Some ( name) = self . 1 {
1945
- write ! ( f, "/{:?}" , name ) ?;
1945
+ write ! ( f, "/{name :?}" ) ?;
1946
1946
}
1947
1947
Ok ( ( ) )
1948
1948
}
@@ -2646,7 +2646,7 @@ mod tests {
2646
2646
fn test_debug_output_valid_utf8 ( ) {
2647
2647
let haystack = b"Hello, world!" ;
2648
2648
let m = Match :: new ( haystack, 7 , 12 ) ;
2649
- let debug_str = format ! ( "{:?}" , m ) ;
2649
+ let debug_str = format ! ( "{m :?}" ) ;
2650
2650
2651
2651
assert_eq ! (
2652
2652
debug_str,
@@ -2658,7 +2658,7 @@ mod tests {
2658
2658
fn test_debug_output_invalid_utf8 ( ) {
2659
2659
let haystack = b"Hello, \xFF world!" ;
2660
2660
let m = Match :: new ( haystack, 7 , 13 ) ;
2661
- let debug_str = format ! ( "{:?}" , m ) ;
2661
+ let debug_str = format ! ( "{m :?}" ) ;
2662
2662
2663
2663
assert_eq ! (
2664
2664
debug_str,
@@ -2671,7 +2671,7 @@ mod tests {
2671
2671
let haystack =
2672
2672
"Hello, 😊 world! 안녕하세요? مرحبا بالعالم!" . as_bytes ( ) ;
2673
2673
let m = Match :: new ( haystack, 0 , haystack. len ( ) ) ;
2674
- let debug_str = format ! ( "{:?}" , m ) ;
2674
+ let debug_str = format ! ( "{m :?}" ) ;
2675
2675
2676
2676
assert_eq ! (
2677
2677
debug_str,
@@ -2683,7 +2683,7 @@ mod tests {
2683
2683
fn test_debug_output_ascii_escape ( ) {
2684
2684
let haystack = b"Hello,\t world!\n This is a \x1b [31mtest\x1b [0m." ;
2685
2685
let m = Match :: new ( haystack, 0 , haystack. len ( ) ) ;
2686
- let debug_str = format ! ( "{:?}" , m ) ;
2686
+ let debug_str = format ! ( "{m :?}" ) ;
2687
2687
2688
2688
assert_eq ! (
2689
2689
debug_str,
@@ -2695,7 +2695,7 @@ mod tests {
2695
2695
fn test_debug_output_match_in_middle ( ) {
2696
2696
let haystack = b"The quick brown fox jumps over the lazy dog." ;
2697
2697
let m = Match :: new ( haystack, 16 , 19 ) ;
2698
- let debug_str = format ! ( "{:?}" , m ) ;
2698
+ let debug_str = format ! ( "{m :?}" ) ;
2699
2699
2700
2700
assert_eq ! ( debug_str, r#"Match { start: 16, end: 19, bytes: "fox" }"# ) ;
2701
2701
}
0 commit comments