@@ -133,16 +133,16 @@ pub(crate) fn move_arm_cond_to_match_guard(
133
133
} ;
134
134
let then_arm_end = match_arm. syntax ( ) . text_range ( ) . end ( ) ;
135
135
let indent_level = match_arm. indent_level ( ) ;
136
- let spaces = " " . repeat ( indent_level. 0 as _ ) ;
136
+ let spaces = indent_level;
137
137
138
138
let mut first = true ;
139
139
for ( cond, block) in conds_blocks {
140
140
if !first {
141
- edit. insert ( then_arm_end, format ! ( "\n {}" , spaces ) ) ;
141
+ edit. insert ( then_arm_end, format ! ( "\n {spaces}" ) ) ;
142
142
} else {
143
143
first = false ;
144
144
}
145
- let guard = format ! ( "{} if {} => " , match_pat , cond . syntax ( ) . text ( ) ) ;
145
+ let guard = format ! ( "{match_pat } if {cond } => " ) ;
146
146
edit. insert ( then_arm_end, guard) ;
147
147
let only_expr = block. statements ( ) . next ( ) . is_none ( ) ;
148
148
match & block. tail_expr ( ) {
@@ -158,7 +158,7 @@ pub(crate) fn move_arm_cond_to_match_guard(
158
158
}
159
159
if let Some ( e) = tail {
160
160
cov_mark:: hit!( move_guard_ifelse_else_tail) ;
161
- let guard = format ! ( "\n {}{ } => " , spaces , match_pat ) ;
161
+ let guard = format ! ( "\n {spaces}{match_pat } => " ) ;
162
162
edit. insert ( then_arm_end, guard) ;
163
163
let only_expr = e. statements ( ) . next ( ) . is_none ( ) ;
164
164
match & e. tail_expr ( ) {
@@ -183,7 +183,7 @@ pub(crate) fn move_arm_cond_to_match_guard(
183
183
{
184
184
cov_mark:: hit!( move_guard_ifelse_has_wildcard) ;
185
185
}
186
- _ => edit. insert ( then_arm_end, format ! ( "\n {}{ } => {{}}" , spaces , match_pat ) ) ,
186
+ _ => edit. insert ( then_arm_end, format ! ( "\n {spaces}{match_pat } => {{}}" ) ) ,
187
187
}
188
188
}
189
189
} ,
0 commit comments