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/hir_expand/src/hygiene.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'crates/hir_expand') diff --git a/crates/hir_expand/src/hygiene.rs b/crates/hir_expand/src/hygiene.rs index c8ea81210..87cad326d 100644 --- a/crates/hir_expand/src/hygiene.rs +++ b/crates/hir_expand/src/hygiene.rs @@ -23,7 +23,7 @@ pub struct Hygiene { impl Hygiene { pub fn new(db: &dyn AstDatabase, file_id: HirFileId) -> Hygiene { - Hygiene { frames: Some(HygieneFrames::new(db, file_id.clone())) } + Hygiene { frames: Some(HygieneFrames::new(db, file_id)) } } pub fn new_unhygienic() -> Hygiene { @@ -129,10 +129,7 @@ impl HygieneInfo { mbe::Origin::Call => (&self.macro_arg.1, self.arg_start), mbe::Origin::Def => ( &self.macro_def.1, - self.def_start - .as_ref() - .expect("`Origin::Def` used with non-`macro_rules!` macro") - .clone(), + *self.def_start.as_ref().expect("`Origin::Def` used with non-`macro_rules!` macro"), ), }; -- cgit v1.2.3