aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
authorLaurenČ›iu Nicola <[email protected]>2021-06-18 12:40:51 +0100
committerLaurenČ›iu Nicola <[email protected]>2021-06-18 12:40:51 +0100
commite3ce88f6f25901b1d33fbc5f931a9d8f90b9e2b8 (patch)
treec6876d5f81bafe5d405f7ab72ff61e4a748a3bc5 /crates/hir_def
parent0d863ccea96c6c3256fad12807a0eedbfccd8294 (diff)
Minor clippy perf fixes
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/resolver.rs3
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 {
640impl HasResolver for ModuleId { 640impl 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));