From 12e3b4c70b5ef23b2fdfc197296d483680e125f9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 8 Feb 2019 14:49:43 +0300 Subject: reformat the world --- crates/ra_hir/src/nameres/lower.rs | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'crates/ra_hir/src/nameres/lower.rs') diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs index 7e6e48ae0..7e9a3de2b 100644 --- a/crates/ra_hir/src/nameres/lower.rs +++ b/crates/ra_hir/src/nameres/lower.rs @@ -82,13 +82,9 @@ impl LoweredModule { let mut source_map = ImportSourceMap::default(); let mut res = LoweredModule::default(); match source { - ModuleSource::SourceFile(it) => res.fill( - &mut source_map, - db, - module, - file_id, - &mut it.items_with_macros(), - ), + ModuleSource::SourceFile(it) => { + res.fill(&mut source_map, db, module, file_id, &mut it.items_with_macros()) + } ModuleSource::Module(it) => { if let Some(item_list) = it.item_list() { res.fill( @@ -121,10 +117,8 @@ impl LoweredModule { } ast::ItemOrMacro::Macro(macro_call) => { let item_id = file_items.id_of_unchecked(macro_call.syntax()); - let loc = MacroCallLoc { - module, - source_item_id: SourceItemId { file_id, item_id }, - }; + let loc = + MacroCallLoc { module, source_item_id: SourceItemId { file_id, item_id } }; let id = loc.id(db); let file_id = HirFileId::from(id); //FIXME: expand recursively @@ -163,22 +157,19 @@ impl LoweredModule { ast::ModuleItemKind::FnDef(it) => { if let Some(name) = it.name() { let func = Function { id: ctx.to_def(it) }; - self.declarations - .insert(name.as_name(), PerNs::values(func.into())); + self.declarations.insert(name.as_name(), PerNs::values(func.into())); } } ast::ModuleItemKind::TraitDef(it) => { if let Some(name) = it.name() { let t = Trait { id: ctx.to_def(it) }; - self.declarations - .insert(name.as_name(), PerNs::types(t.into())); + self.declarations.insert(name.as_name(), PerNs::types(t.into())); } } ast::ModuleItemKind::TypeDef(it) => { if let Some(name) = it.name() { let t = Type { id: ctx.to_def(it) }; - self.declarations - .insert(name.as_name(), PerNs::types(t.into())); + self.declarations.insert(name.as_name(), PerNs::types(t.into())); } } ast::ModuleItemKind::ImplBlock(_) => { @@ -207,15 +198,13 @@ impl LoweredModule { ast::ModuleItemKind::ConstDef(it) => { if let Some(name) = it.name() { let c = Const { id: ctx.to_def(it) }; - self.declarations - .insert(name.as_name(), PerNs::values(c.into())); + self.declarations.insert(name.as_name(), PerNs::values(c.into())); } } ast::ModuleItemKind::StaticDef(it) => { if let Some(name) = it.name() { let s = Static { id: ctx.to_def(it) }; - self.declarations - .insert(name.as_name(), PerNs::values(s.into())); + self.declarations.insert(name.as_name(), PerNs::values(s.into())); } } ast::ModuleItemKind::Module(_) => { -- cgit v1.2.3