aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/resolver.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-18 13:18:25 +0100
committerGitHub <[email protected]>2021-06-18 13:18:25 +0100
commit7eb843b218b5e10b39a5171f5b9689ec6c2d71c3 (patch)
tree64e3deddd104187ff8aa9b5dd9c64819a5378f1d /crates/hir_def/src/resolver.rs
parent86c3c42d8ed060b66df95f33c20c1f5778c38ee0 (diff)
parent6b1f0057f2dbe48f1c59c8938957daf158e30823 (diff)
Merge #9325
9325: Minor: clippy perf fixes r=matklad a=lnicola Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates/hir_def/src/resolver.rs')
-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));