From 9fd2c813ca355c3a1f10f54993c16e81778b867b Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 27 Dec 2019 11:24:31 +0100 Subject: visible_from -> is_visible_from --- crates/ra_hir_def/src/nameres/collector.rs | 6 +++--- crates/ra_hir_def/src/visibility.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_hir_def') 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 .resolutions() // only keep visible names... .map(|(n, res)| { - (n, res.filter_visibility(|v| v.visible_from_other_crate())) + (n, res.filter_visibility(|v| v.is_visible_from_other_crate())) }) .filter(|(_, res)| !res.is_none()) .collect::>(); @@ -398,7 +398,7 @@ where ( n, res.filter_visibility(|v| { - v.visible_from_def_map(&self.def_map, module_id) + v.is_visible_from_def_map(&self.def_map, module_id) }), ) }) @@ -492,7 +492,7 @@ where for (glob_importing_module, glob_import_vis) in glob_imports { // we know all resolutions have the same visibility (`vis`), so we // just need to check that once - if !vis.visible_from_def_map(&self.def_map, glob_importing_module) { + if !vis.is_visible_from_def_map(&self.def_map, glob_importing_module) { continue; } 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 { } impl Visibility { - pub fn visible_from(self, db: &impl DefDatabase, from_module: ModuleId) -> bool { + pub fn is_visible_from(self, db: &impl DefDatabase, from_module: ModuleId) -> bool { let to_module = match self { Visibility::Module(m) => m, Visibility::Public => return true, @@ -91,17 +91,17 @@ impl Visibility { return false; } let def_map = db.crate_def_map(from_module.krate); - self.visible_from_def_map(&def_map, from_module.local_id) + self.is_visible_from_def_map(&def_map, from_module.local_id) } - pub(crate) fn visible_from_other_crate(self) -> bool { + pub(crate) fn is_visible_from_other_crate(self) -> bool { match self { Visibility::Module(_) => false, Visibility::Public => true, } } - pub(crate) fn visible_from_def_map( + pub(crate) fn is_visible_from_def_map( self, def_map: &crate::nameres::CrateDefMap, from_module: crate::LocalModuleId, -- cgit v1.2.3