diff options
author | Florian Diebold <[email protected]> | 2019-12-27 10:24:31 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-12-27 10:25:04 +0000 |
commit | 9fd2c813ca355c3a1f10f54993c16e81778b867b (patch) | |
tree | 119623fdc795c0e41a7171abe90d3961f24fac7c /crates/ra_hir_def/src | |
parent | dfe95d735bf9bb0d49d2ab90438577089207c8a0 (diff) |
visible_from -> is_visible_from
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir_def/src/visibility.rs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 30771d510..8a22b0585 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -378,7 +378,7 @@ where | |||
378 | .resolutions() | 378 | .resolutions() |
379 | // only keep visible names... | 379 | // only keep visible names... |
380 | .map(|(n, res)| { | 380 | .map(|(n, res)| { |
381 | (n, res.filter_visibility(|v| v.visible_from_other_crate())) | 381 | (n, res.filter_visibility(|v| v.is_visible_from_other_crate())) |
382 | }) | 382 | }) |
383 | .filter(|(_, res)| !res.is_none()) | 383 | .filter(|(_, res)| !res.is_none()) |
384 | .collect::<Vec<_>>(); | 384 | .collect::<Vec<_>>(); |
@@ -398,7 +398,7 @@ where | |||
398 | ( | 398 | ( |
399 | n, | 399 | n, |
400 | res.filter_visibility(|v| { | 400 | res.filter_visibility(|v| { |
401 | v.visible_from_def_map(&self.def_map, module_id) | 401 | v.is_visible_from_def_map(&self.def_map, module_id) |
402 | }), | 402 | }), |
403 | ) | 403 | ) |
404 | }) | 404 | }) |
@@ -492,7 +492,7 @@ where | |||
492 | for (glob_importing_module, glob_import_vis) in glob_imports { | 492 | for (glob_importing_module, glob_import_vis) in glob_imports { |
493 | // we know all resolutions have the same visibility (`vis`), so we | 493 | // we know all resolutions have the same visibility (`vis`), so we |
494 | // just need to check that once | 494 | // just need to check that once |
495 | if !vis.visible_from_def_map(&self.def_map, glob_importing_module) { | 495 | if !vis.is_visible_from_def_map(&self.def_map, glob_importing_module) { |
496 | continue; | 496 | continue; |
497 | } | 497 | } |
498 | self.update_recursive(glob_importing_module, resolutions, glob_import_vis, depth + 1); | 498 | self.update_recursive(glob_importing_module, resolutions, glob_import_vis, depth + 1); |
diff --git a/crates/ra_hir_def/src/visibility.rs b/crates/ra_hir_def/src/visibility.rs index ad3f09981..d8296da4b 100644 --- a/crates/ra_hir_def/src/visibility.rs +++ b/crates/ra_hir_def/src/visibility.rs | |||
@@ -81,7 +81,7 @@ pub enum Visibility { | |||
81 | } | 81 | } |
82 | 82 | ||
83 | impl Visibility { | 83 | impl Visibility { |
84 | pub fn visible_from(self, db: &impl DefDatabase, from_module: ModuleId) -> bool { | 84 | pub fn is_visible_from(self, db: &impl DefDatabase, from_module: ModuleId) -> bool { |
85 | let to_module = match self { | 85 | let to_module = match self { |
86 | Visibility::Module(m) => m, | 86 | Visibility::Module(m) => m, |
87 | Visibility::Public => return true, | 87 | Visibility::Public => return true, |
@@ -91,17 +91,17 @@ impl Visibility { | |||
91 | return false; | 91 | return false; |
92 | } | 92 | } |
93 | let def_map = db.crate_def_map(from_module.krate); | 93 | let def_map = db.crate_def_map(from_module.krate); |
94 | self.visible_from_def_map(&def_map, from_module.local_id) | 94 | self.is_visible_from_def_map(&def_map, from_module.local_id) |
95 | } | 95 | } |
96 | 96 | ||
97 | pub(crate) fn visible_from_other_crate(self) -> bool { | 97 | pub(crate) fn is_visible_from_other_crate(self) -> bool { |
98 | match self { | 98 | match self { |
99 | Visibility::Module(_) => false, | 99 | Visibility::Module(_) => false, |
100 | Visibility::Public => true, | 100 | Visibility::Public => true, |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | pub(crate) fn visible_from_def_map( | 104 | pub(crate) fn is_visible_from_def_map( |
105 | self, | 105 | self, |
106 | def_map: &crate::nameres::CrateDefMap, | 106 | def_map: &crate::nameres::CrateDefMap, |
107 | from_module: crate::LocalModuleId, | 107 | from_module: crate::LocalModuleId, |