@@ -34,7 +34,7 @@ fn output_file_suffix(testfile: &Path, bit_width: u32, panic_strategy: PanicStra
34
34
35
35
let mut suffix = String :: new ( ) ;
36
36
if each_bit_width {
37
- suffix. push_str ( & format ! ( ".{}bit" , bit_width ) ) ;
37
+ suffix. push_str ( & format ! ( ".{bit_width }bit" ) ) ;
38
38
}
39
39
if each_panic_strategy {
40
40
match panic_strategy {
@@ -51,7 +51,7 @@ pub fn files_for_miropt_test(
51
51
panic_strategy : PanicStrategy ,
52
52
) -> MiroptTest {
53
53
let mut out = Vec :: new ( ) ;
54
- let test_file_contents = fs:: read_to_string ( & testfile) . unwrap ( ) ;
54
+ let test_file_contents = fs:: read_to_string ( testfile) . unwrap ( ) ;
55
55
56
56
let test_dir = testfile. parent ( ) . unwrap ( ) ;
57
57
let test_crate = testfile. file_stem ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . replace ( '-' , "_" ) ;
@@ -76,10 +76,10 @@ pub fn files_for_miropt_test(
76
76
77
77
if test_name. ends_with ( ".diff" ) {
78
78
let trimmed = test_name. trim_end_matches ( ".diff" ) ;
79
- passes. push ( trimmed. split ( '.' ) . last ( ) . unwrap ( ) . to_owned ( ) ) ;
80
- let test_against = format ! ( "{}.after.mir" , trimmed ) ;
81
- from_file = format ! ( "{}.before.mir" , trimmed ) ;
82
- expected_file = format ! ( "{}{ }.diff" , trimmed , suffix ) ;
79
+ passes. push ( trimmed. split ( '.' ) . next_back ( ) . unwrap ( ) . to_owned ( ) ) ;
80
+ let test_against = format ! ( "{trimmed }.after.mir" ) ;
81
+ from_file = format ! ( "{trimmed }.before.mir" ) ;
82
+ expected_file = format ! ( "{trimmed}{suffix }.diff" ) ;
83
83
assert ! ( test_names. next( ) . is_none( ) , "two mir pass names specified for MIR diff" ) ;
84
84
to_file = Some ( test_against) ;
85
85
} else if let Some ( first_pass) = test_names. next ( ) {
@@ -93,9 +93,9 @@ pub fn files_for_miropt_test(
93
93
assert ! ( test_names. next( ) . is_none( ) , "three mir pass names specified for MIR diff" ) ;
94
94
95
95
expected_file =
96
- format ! ( "{}{ }.{}-{}.diff" , test_name , suffix , first_pass , second_pass ) ;
97
- let second_file = format ! ( "{}.{}.mir" , test_name , second_pass ) ;
98
- from_file = format ! ( "{}.{}.mir" , test_name , first_pass ) ;
96
+ format ! ( "{test_name}{suffix }.{first_pass }-{second_pass }.diff" ) ;
97
+ let second_file = format ! ( "{test_name }.{second_pass }.mir" ) ;
98
+ from_file = format ! ( "{test_name }.{first_pass }.mir" ) ;
99
99
to_file = Some ( second_file) ;
100
100
} else {
101
101
// Allow-list for file extensions that can be produced by MIR dumps.
@@ -112,7 +112,7 @@ pub fn files_for_miropt_test(
112
112
)
113
113
}
114
114
115
- expected_file = format ! ( "{}{ }.{}" , test_name_wo_ext , suffix , test_name_ext ) ;
115
+ expected_file = format ! ( "{test_name_wo_ext}{suffix }.{test_name_ext}" ) ;
116
116
from_file = test_name. to_string ( ) ;
117
117
assert ! ( test_names. next( ) . is_none( ) , "two mir pass names specified for MIR dump" ) ;
118
118
to_file = None ;
@@ -123,7 +123,7 @@ pub fn files_for_miropt_test(
123
123
) ;
124
124
} ;
125
125
if !expected_file. starts_with ( & test_crate) {
126
- expected_file = format ! ( "{}.{}" , test_crate , expected_file ) ;
126
+ expected_file = format ! ( "{test_crate }.{expected_file}" ) ;
127
127
}
128
128
let expected_file = test_dir. join ( expected_file) ;
129
129
0 commit comments