@@ -119,19 +119,19 @@ pub(crate) fn convert_for_loop_with_for_each(
119119 {
120120 // We have either "for x in &col" and col implements a method called iter
121121 // or "for x in &mut col" and col implements a method called iter_mut
122- format_to ! ( buf, "{}.{}()" , expr_behind_ref , method ) ;
122+ format_to ! ( buf, "{expr_behind_ref }.{method }()" ) ;
123123 } else if let ast:: Expr :: RangeExpr ( ..) = iterable {
124124 // range expressions need to be parenthesized for the syntax to be correct
125- format_to ! ( buf, "({})" , iterable ) ;
125+ format_to ! ( buf, "({iterable })" ) ;
126126 } else if impls_core_iter ( & ctx. sema , & iterable) {
127- format_to ! ( buf, "{}" , iterable ) ;
127+ format_to ! ( buf, "{iterable}" ) ;
128128 } else if let ast:: Expr :: RefExpr ( _) = iterable {
129- format_to ! ( buf, "({}).into_iter()" , iterable ) ;
129+ format_to ! ( buf, "({iterable }).into_iter()" ) ;
130130 } else {
131- format_to ! ( buf, "{}.into_iter()" , iterable ) ;
131+ format_to ! ( buf, "{iterable }.into_iter()" ) ;
132132 }
133133
134- format_to ! ( buf, ".for_each(|{}| {});" , pat , body ) ;
134+ format_to ! ( buf, ".for_each(|{pat }| {body });" ) ;
135135
136136 builder. replace ( for_loop. syntax ( ) . text_range ( ) , buf)
137137 } ,
0 commit comments