@@ -133,16 +133,16 @@ pub(crate) fn move_arm_cond_to_match_guard(
133133 } ;
134134 let then_arm_end = match_arm. syntax ( ) . text_range ( ) . end ( ) ;
135135 let indent_level = match_arm. indent_level ( ) ;
136- let spaces = " " . repeat ( indent_level. 0 as _ ) ;
136+ let spaces = indent_level;
137137
138138 let mut first = true ;
139139 for ( cond, block) in conds_blocks {
140140 if !first {
141- edit. insert ( then_arm_end, format ! ( "\n {}" , spaces ) ) ;
141+ edit. insert ( then_arm_end, format ! ( "\n {spaces}" ) ) ;
142142 } else {
143143 first = false ;
144144 }
145- let guard = format ! ( "{} if {} => " , match_pat , cond . syntax ( ) . text ( ) ) ;
145+ let guard = format ! ( "{match_pat } if {cond } => " ) ;
146146 edit. insert ( then_arm_end, guard) ;
147147 let only_expr = block. statements ( ) . next ( ) . is_none ( ) ;
148148 match & block. tail_expr ( ) {
@@ -158,7 +158,7 @@ pub(crate) fn move_arm_cond_to_match_guard(
158158 }
159159 if let Some ( e) = tail {
160160 cov_mark:: hit!( move_guard_ifelse_else_tail) ;
161- let guard = format ! ( "\n {}{ } => " , spaces , match_pat ) ;
161+ let guard = format ! ( "\n {spaces}{match_pat } => " ) ;
162162 edit. insert ( then_arm_end, guard) ;
163163 let only_expr = e. statements ( ) . next ( ) . is_none ( ) ;
164164 match & e. tail_expr ( ) {
@@ -183,7 +183,7 @@ pub(crate) fn move_arm_cond_to_match_guard(
183183 {
184184 cov_mark:: hit!( move_guard_ifelse_has_wildcard) ;
185185 }
186- _ => edit. insert ( then_arm_end, format ! ( "\n {}{ } => {{}}" , spaces , match_pat ) ) ,
186+ _ => edit. insert ( then_arm_end, format ! ( "\n {spaces}{match_pat } => {{}}" ) ) ,
187187 }
188188 }
189189 } ,
0 commit comments