about summary refs log tree commit diff
path: root/compiler/rustc_ast_pretty
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-04-24 08:49:49 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-04-24 11:12:34 +1000
commit055a27da2afcc8a7d74a551c32e8a831a825d549 (patch)
tree0e167ff7afcba57293c846f18ea79f112db4ed66 /compiler/rustc_ast_pretty
parentb8c54d6358926028ac2fab1ec2b8665c70edb1c0 (diff)
downloadrust-055a27da2afcc8a7d74a551c32e8a831a825d549.tar.gz
rust-055a27da2afcc8a7d74a551c32e8a831a825d549.zip
Remove some unnecessary clones.
I found these by grepping for `&[a-z_\.]*\.clone()`, i.e. expressions
like `&a.b.clone()`, which are sometimes unnecessary clones, and also
looking at clones nearby to cases like that.
Diffstat (limited to 'compiler/rustc_ast_pretty')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs
index 0985ebf945b..194ae9041b1 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state.rs
@@ -799,7 +799,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
             has_bang,
             Some(*ident),
             macro_def.body.delim,
-            &macro_def.body.tokens.clone(),
+            &macro_def.body.tokens,
             true,
             sp,
         );
@@ -1469,7 +1469,7 @@ impl<'a> State<'a> {
             true,
             None,
             m.args.delim,
-            &m.args.tokens.clone(),
+            &m.args.tokens,
             true,
             m.span(),
         );