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/hir_expand | |
parent | c5d654d5132b702d028ed00b5ec5c654a0b4a2fa (diff) |
don't clone types that are copy (clippy::clone_on_copy)
Diffstat (limited to 'crates/hir_expand')
-rw-r--r-- | crates/hir_expand/src/hygiene.rs | 7 |
1 files changed, 2 insertions, 5 deletions
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 { | |||
23 | 23 | ||
24 | impl Hygiene { | 24 | impl Hygiene { |
25 | pub fn new(db: &dyn AstDatabase, file_id: HirFileId) -> Hygiene { | 25 | pub fn new(db: &dyn AstDatabase, file_id: HirFileId) -> Hygiene { |
26 | Hygiene { frames: Some(HygieneFrames::new(db, file_id.clone())) } | 26 | Hygiene { frames: Some(HygieneFrames::new(db, file_id)) } |
27 | } | 27 | } |
28 | 28 | ||
29 | pub fn new_unhygienic() -> Hygiene { | 29 | pub fn new_unhygienic() -> Hygiene { |
@@ -129,10 +129,7 @@ impl HygieneInfo { | |||
129 | mbe::Origin::Call => (&self.macro_arg.1, self.arg_start), | 129 | mbe::Origin::Call => (&self.macro_arg.1, self.arg_start), |
130 | mbe::Origin::Def => ( | 130 | mbe::Origin::Def => ( |
131 | &self.macro_def.1, | 131 | &self.macro_def.1, |
132 | self.def_start | 132 | *self.def_start.as_ref().expect("`Origin::Def` used with non-`macro_rules!` macro"), |
133 | .as_ref() | ||
134 | .expect("`Origin::Def` used with non-`macro_rules!` macro") | ||
135 | .clone(), | ||
136 | ), | 133 | ), |
137 | }; | 134 | }; |
138 | 135 | ||