diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-24 08:49:49 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-24 11:12:34 +1000 |
| commit | 055a27da2afcc8a7d74a551c32e8a831a825d549 (patch) | |
| tree | 0e167ff7afcba57293c846f18ea79f112db4ed66 /compiler/rustc_ast_pretty | |
| parent | b8c54d6358926028ac2fab1ec2b8665c70edb1c0 (diff) | |
| download | rust-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.rs | 4 |
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, - ¯o_def.body.tokens.clone(), + ¯o_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(), ); |
