diff options
author | Ville Penttinen <[email protected]> | 2019-02-21 22:11:21 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-02-21 22:11:21 +0000 |
commit | a34eb98a781453a66ce0442e1f7722c0774ae49f (patch) | |
tree | 4aee9db8248a6d669f3cd832d1e2a6bd448e3208 /crates/ra_hir/src | |
parent | 2e7bc905be156a007a4ee8f1a1bd1d73a1d19ade (diff) |
Make nameres::ResolvePathResult private and refactor
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/nameres.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index b18721104..8067b8415 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs | |||
@@ -304,7 +304,7 @@ where | |||
304 | &import.path, | 304 | &import.path, |
305 | ); | 305 | ); |
306 | 306 | ||
307 | (res.module, res.reached_fixedpoint) | 307 | (res.resolved_def, res.reached_fixedpoint) |
308 | }; | 308 | }; |
309 | 309 | ||
310 | if reached_fixedpoint != ReachedFixedPoint::Yes { | 310 | if reached_fixedpoint != ReachedFixedPoint::Yes { |
@@ -443,9 +443,9 @@ where | |||
443 | } | 443 | } |
444 | 444 | ||
445 | #[derive(Debug, Clone)] | 445 | #[derive(Debug, Clone)] |
446 | pub struct ResolvePathResult { | 446 | struct ResolvePathResult { |
447 | pub(crate) module: PerNs<ModuleDef>, | 447 | resolved_def: PerNs<ModuleDef>, |
448 | pub(crate) segment_index: Option<usize>, | 448 | segment_index: Option<usize>, |
449 | reached_fixedpoint: ReachedFixedPoint, | 449 | reached_fixedpoint: ReachedFixedPoint, |
450 | } | 450 | } |
451 | 451 | ||
@@ -455,11 +455,11 @@ impl ResolvePathResult { | |||
455 | } | 455 | } |
456 | 456 | ||
457 | fn with( | 457 | fn with( |
458 | module: PerNs<ModuleDef>, | 458 | resolved_def: PerNs<ModuleDef>, |
459 | reached_fixedpoint: ReachedFixedPoint, | 459 | reached_fixedpoint: ReachedFixedPoint, |
460 | segment_index: Option<usize>, | 460 | segment_index: Option<usize>, |
461 | ) -> ResolvePathResult { | 461 | ) -> ResolvePathResult { |
462 | ResolvePathResult { module, reached_fixedpoint, segment_index } | 462 | ResolvePathResult { resolved_def, reached_fixedpoint, segment_index } |
463 | } | 463 | } |
464 | } | 464 | } |
465 | 465 | ||
@@ -498,7 +498,7 @@ impl ItemMap { | |||
498 | path: &Path, | 498 | path: &Path, |
499 | ) -> (PerNs<ModuleDef>, Option<usize>) { | 499 | ) -> (PerNs<ModuleDef>, Option<usize>) { |
500 | let res = self.resolve_path_fp(db, ResolveMode::Other, original_module, path); | 500 | let res = self.resolve_path_fp(db, ResolveMode::Other, original_module, path); |
501 | (res.module, res.segment_index) | 501 | (res.resolved_def, res.segment_index) |
502 | } | 502 | } |
503 | 503 | ||
504 | fn resolve_in_prelude( | 504 | fn resolve_in_prelude( |