@@ -249,11 +249,11 @@ pub fn impl_(
249249 let gen_params = generic_params. map_or_else ( String :: new, |it| it. to_string ( ) ) ;
250250
251251 let body_newline =
252- if where_clause. is_some ( ) && body. is_none ( ) { "\n " . to_string ( ) } else { String :: new ( ) } ;
252+ if where_clause. is_some ( ) && body. is_none ( ) { "\n " . to_owned ( ) } else { String :: new ( ) } ;
253253
254254 let where_clause = match where_clause {
255255 Some ( pr) => format ! ( "\n {pr}\n " ) ,
256- None => " " . to_string ( ) ,
256+ None => " " . to_owned ( ) ,
257257 } ;
258258
259259 let body = match body {
@@ -291,13 +291,13 @@ pub fn impl_trait(
291291
292292 let body_newline =
293293 if ( ty_where_clause. is_some ( ) || trait_where_clause. is_some ( ) ) && body. is_none ( ) {
294- "\n " . to_string ( )
294+ "\n " . to_owned ( )
295295 } else {
296296 String :: new ( )
297297 } ;
298298
299299 let where_clause = merge_where_clause ( ty_where_clause, trait_where_clause)
300- . map_or_else ( || " " . to_string ( ) , |wc| format ! ( "\n {}\n " , wc) ) ;
300+ . map_or_else ( || " " . to_owned ( ) , |wc| format ! ( "\n {}\n " , wc) ) ;
301301
302302 let body = match body {
303303 Some ( bd) => bd. iter ( ) . map ( |elem| elem. to_string ( ) ) . join ( "" ) ,
@@ -378,7 +378,7 @@ pub fn use_tree(
378378 alias : Option < ast:: Rename > ,
379379 add_star : bool ,
380380) -> ast:: UseTree {
381- let mut buf = "use " . to_string ( ) ;
381+ let mut buf = "use " . to_owned ( ) ;
382382 buf += & path. syntax ( ) . to_string ( ) ;
383383 if let Some ( use_tree_list) = use_tree_list {
384384 format_to ! ( buf, "::{use_tree_list}" ) ;
@@ -444,7 +444,7 @@ pub fn block_expr(
444444 stmts : impl IntoIterator < Item = ast:: Stmt > ,
445445 tail_expr : Option < ast:: Expr > ,
446446) -> ast:: BlockExpr {
447- let mut buf = "{\n " . to_string ( ) ;
447+ let mut buf = "{\n " . to_owned ( ) ;
448448 for stmt in stmts. into_iter ( ) {
449449 format_to ! ( buf, " {stmt}\n " ) ;
450450 }
@@ -459,7 +459,7 @@ pub fn async_move_block_expr(
459459 stmts : impl IntoIterator < Item = ast:: Stmt > ,
460460 tail_expr : Option < ast:: Expr > ,
461461) -> ast:: BlockExpr {
462- let mut buf = "async move {\n " . to_string ( ) ;
462+ let mut buf = "async move {\n " . to_owned ( ) ;
463463 for stmt in stmts. into_iter ( ) {
464464 format_to ! ( buf, " {stmt}\n " ) ;
465465 }
@@ -482,7 +482,7 @@ pub fn hacky_block_expr(
482482 elements : impl IntoIterator < Item = crate :: SyntaxElement > ,
483483 tail_expr : Option < ast:: Expr > ,
484484) -> ast:: BlockExpr {
485- let mut buf = "{\n " . to_string ( ) ;
485+ let mut buf = "{\n " . to_owned ( ) ;
486486 for node_or_token in elements. into_iter ( ) {
487487 match node_or_token {
488488 rowan:: NodeOrToken :: Node ( n) => format_to ! ( buf, " {n}\n " ) ,
0 commit comments