diff options
author | Aleksey Kladov <[email protected]> | 2019-11-08 20:53:39 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-08 20:53:39 +0000 |
commit | 785887b3829e2753cefcde48f527cf829fd051f4 (patch) | |
tree | c58a545bd0530e0141bc7acbd001be43b9182227 /crates/ra_hir_def | |
parent | dc5e5f610cf057654bce9d8fcf275ae375299f90 (diff) |
Simplify
There's only one call-site for the function, so it seems fine to
inline
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/nameres.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 6 |
2 files changed, 5 insertions, 7 deletions
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 { | |||
195 | pub import: Option<ImportId>, | 195 | pub import: Option<ImportId>, |
196 | } | 196 | } |
197 | 197 | ||
198 | impl Resolution { | ||
199 | fn from_macro(macro_: MacroDefId) -> Self { | ||
200 | Resolution { def: PerNs::macros(macro_), import: None } | ||
201 | } | ||
202 | } | ||
203 | |||
204 | #[derive(Debug, Clone)] | 198 | #[derive(Debug, Clone)] |
205 | struct ResolvePathResult { | 199 | struct ResolvePathResult { |
206 | resolved_def: PerNs, | 200 | 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 | |||
182 | // In Rust, `#[macro_export]` macros are unconditionally visible at the | 182 | // In Rust, `#[macro_export]` macros are unconditionally visible at the |
183 | // crate root, even if the parent modules is **not** visible. | 183 | // crate root, even if the parent modules is **not** visible. |
184 | if export { | 184 | if export { |
185 | self.update(self.def_map.root, None, &[(name, Resolution::from_macro(macro_))]); | 185 | self.update( |
186 | self.def_map.root, | ||
187 | None, | ||
188 | &[(name, Resolution { def: PerNs::macros(macro_), import: None })], | ||
189 | ); | ||
186 | } | 190 | } |
187 | } | 191 | } |
188 | 192 | ||