From e3ce88f6f25901b1d33fbc5f931a9d8f90b9e2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Fri, 18 Jun 2021 14:40:51 +0300 Subject: Minor clippy perf fixes --- crates/hir_def/src/resolver.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/hir_def') 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 { impl HasResolver for ModuleId { fn resolver(self, db: &dyn DefDatabase) -> Resolver { let mut def_map = self.def_map(db); - let mut modules = Vec::new(); - modules.push((def_map.clone(), self.local_id)); + let mut modules = vec![(def_map.clone(), self.local_id)]; while let Some(parent) = def_map.parent() { def_map = parent.def_map(db); modules.push((def_map.clone(), parent.local_id)); -- cgit v1.2.3