From 785887b3829e2753cefcde48f527cf829fd051f4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 8 Nov 2019 23:53:39 +0300 Subject: Simplify There's only one call-site for the function, so it seems fine to inline --- crates/ra_hir_def/src/nameres.rs | 6 ------ crates/ra_hir_def/src/nameres/collector.rs | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs index e1959cdb9..fb3ba5305 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/ra_hir_def/src/nameres.rs @@ -195,12 +195,6 @@ pub struct Resolution { pub import: Option, } -impl Resolution { - fn from_macro(macro_: MacroDefId) -> Self { - Resolution { def: PerNs::macros(macro_), import: None } - } -} - #[derive(Debug, Clone)] struct ResolvePathResult { resolved_def: PerNs, diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 3b61d9895..9ab378d54 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs @@ -182,7 +182,11 @@ where // In Rust, `#[macro_export]` macros are unconditionally visible at the // crate root, even if the parent modules is **not** visible. if export { - self.update(self.def_map.root, None, &[(name, Resolution::from_macro(macro_))]); + self.update( + self.def_map.root, + None, + &[(name, Resolution { def: PerNs::macros(macro_), import: None })], + ); } } -- cgit v1.2.3