diff options
author | Laurențiu Nicola <[email protected]> | 2021-06-18 12:40:51 +0100 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2021-06-18 12:40:51 +0100 |
commit | e3ce88f6f25901b1d33fbc5f931a9d8f90b9e2b8 (patch) | |
tree | c6876d5f81bafe5d405f7ab72ff61e4a748a3bc5 /crates/hir_def/src | |
parent | 0d863ccea96c6c3256fad12807a0eedbfccd8294 (diff) |
Minor clippy perf fixes
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/resolver.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs index 47e56259f..49c573087 100644 --- a/crates/hir_def/src/resolver.rs +++ b/crates/hir_def/src/resolver.rs | |||
@@ -640,8 +640,7 @@ pub trait HasResolver: Copy { | |||
640 | impl HasResolver for ModuleId { | 640 | impl HasResolver for ModuleId { |
641 | fn resolver(self, db: &dyn DefDatabase) -> Resolver { | 641 | fn resolver(self, db: &dyn DefDatabase) -> Resolver { |
642 | let mut def_map = self.def_map(db); | 642 | let mut def_map = self.def_map(db); |
643 | let mut modules = Vec::new(); | 643 | let mut modules = vec![(def_map.clone(), self.local_id)]; |
644 | modules.push((def_map.clone(), self.local_id)); | ||
645 | while let Some(parent) = def_map.parent() { | 644 | while let Some(parent) = def_map.parent() { |
646 | def_map = parent.def_map(db); | 645 | def_map = parent.def_map(db); |
647 | modules.push((def_map.clone(), parent.local_id)); | 646 | modules.push((def_map.clone(), parent.local_id)); |