diff options
author | Matthias Krüger <[email protected]> | 2021-03-17 00:56:31 +0000 |
---|---|---|
committer | Matthias Krüger <[email protected]> | 2021-03-17 00:56:31 +0000 |
commit | 048dad8c2e86006e53b3a134279729efb28b9e32 (patch) | |
tree | b9e584f4d1c276b60cb0bd7cee3a4ad158a0ac66 /crates/ide_completion/src/completions | |
parent | c5d654d5132b702d028ed00b5ec5c654a0b4a2fa (diff) |
don't clone types that are copy (clippy::clone_on_copy)
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r-- | crates/ide_completion/src/completions/pattern.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_completion/src/completions/pattern.rs b/crates/ide_completion/src/completions/pattern.rs index 46cef58f0..476eecff0 100644 --- a/crates/ide_completion/src/completions/pattern.rs +++ b/crates/ide_completion/src/completions/pattern.rs | |||
@@ -26,11 +26,11 @@ pub(crate) fn complete_pattern(acc: &mut Completions, ctx: &CompletionContext) { | |||
26 | let add_resolution = match &res { | 26 | let add_resolution = match &res { |
27 | hir::ScopeDef::ModuleDef(def) => match def { | 27 | hir::ScopeDef::ModuleDef(def) => match def { |
28 | hir::ModuleDef::Adt(hir::Adt::Struct(strukt)) => { | 28 | hir::ModuleDef::Adt(hir::Adt::Struct(strukt)) => { |
29 | acc.add_struct_pat(ctx, strukt.clone(), Some(name.clone())); | 29 | acc.add_struct_pat(ctx, *strukt, Some(name.clone())); |
30 | true | 30 | true |
31 | } | 31 | } |
32 | hir::ModuleDef::Variant(variant) if !ctx.is_irrefutable_pat_binding => { | 32 | hir::ModuleDef::Variant(variant) if !ctx.is_irrefutable_pat_binding => { |
33 | acc.add_variant_pat(ctx, variant.clone(), Some(name.clone())); | 33 | acc.add_variant_pat(ctx, *variant, Some(name.clone())); |
34 | true | 34 | true |
35 | } | 35 | } |
36 | hir::ModuleDef::Adt(hir::Adt::Enum(..)) | 36 | hir::ModuleDef::Adt(hir::Adt::Enum(..)) |