@@ -119,19 +119,19 @@ pub(crate) fn convert_for_loop_with_for_each(
119
119
{
120
120
// We have either "for x in &col" and col implements a method called iter
121
121
// 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 }()" ) ;
123
123
} else if let ast:: Expr :: RangeExpr ( ..) = iterable {
124
124
// range expressions need to be parenthesized for the syntax to be correct
125
- format_to ! ( buf, "({})" , iterable ) ;
125
+ format_to ! ( buf, "({iterable })" ) ;
126
126
} else if impls_core_iter ( & ctx. sema , & iterable) {
127
- format_to ! ( buf, "{}" , iterable ) ;
127
+ format_to ! ( buf, "{iterable}" ) ;
128
128
} else if let ast:: Expr :: RefExpr ( _) = iterable {
129
- format_to ! ( buf, "({}).into_iter()" , iterable ) ;
129
+ format_to ! ( buf, "({iterable }).into_iter()" ) ;
130
130
} else {
131
- format_to ! ( buf, "{}.into_iter()" , iterable ) ;
131
+ format_to ! ( buf, "{iterable }.into_iter()" ) ;
132
132
}
133
133
134
- format_to ! ( buf, ".for_each(|{}| {});" , pat , body ) ;
134
+ format_to ! ( buf, ".for_each(|{pat }| {body });" ) ;
135
135
136
136
builder. replace ( for_loop. syntax ( ) . text_range ( ) , buf)
137
137
} ,
0 commit comments