From 048dad8c2e86006e53b3a134279729efb28b9e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 17 Mar 2021 01:56:31 +0100 Subject: don't clone types that are copy (clippy::clone_on_copy) --- crates/ide_completion/src/completions/pattern.rs | 4 ++-- crates/ide_completion/src/render.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ide_completion') 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) { let add_resolution = match &res { hir::ScopeDef::ModuleDef(def) => match def { hir::ModuleDef::Adt(hir::Adt::Struct(strukt)) => { - acc.add_struct_pat(ctx, strukt.clone(), Some(name.clone())); + acc.add_struct_pat(ctx, *strukt, Some(name.clone())); true } hir::ModuleDef::Variant(variant) if !ctx.is_irrefutable_pat_binding => { - acc.add_variant_pat(ctx, variant.clone(), Some(name.clone())); + acc.add_variant_pat(ctx, *variant, Some(name.clone())); true } 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> { } fn snippet_cap(&self) -> Option { - self.completion.config.snippet_cap.clone() + self.completion.config.snippet_cap } fn db(&self) -> &'a RootDatabase { -- cgit v1.2.3