aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion
diff options
context:
space:
mode:
authorMatthias Krüger <[email protected]>2021-03-17 00:56:31 +0000
committerMatthias Krüger <[email protected]>2021-03-17 00:56:31 +0000
commit048dad8c2e86006e53b3a134279729efb28b9e32 (patch)
treeb9e584f4d1c276b60cb0bd7cee3a4ad158a0ac66 /crates/ide_completion
parentc5d654d5132b702d028ed00b5ec5c654a0b4a2fa (diff)
don't clone types that are copy (clippy::clone_on_copy)
Diffstat (limited to 'crates/ide_completion')
-rw-r--r--crates/ide_completion/src/completions/pattern.rs4
-rw-r--r--crates/ide_completion/src/render.rs2
2 files changed, 3 insertions, 3 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(..))
diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs
index 4e4923e0d..12921e12b 100644
--- a/crates/ide_completion/src/render.rs
+++ b/crates/ide_completion/src/render.rs
@@ -81,7 +81,7 @@ impl<'a> RenderContext<'a> {
81 } 81 }
82 82
83 fn snippet_cap(&self) -> Option<SnippetCap> { 83 fn snippet_cap(&self) -> Option<SnippetCap> {
84 self.completion.config.snippet_cap.clone() 84 self.completion.config.snippet_cap
85 } 85 }
86 86
87 fn db(&self) -> &'a RootDatabase { 87 fn db(&self) -> &'a RootDatabase {