From d04ecc841904401ff17c723702b3332b64235212 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 4 Nov 2019 21:42:25 +0300 Subject: Reduce visibility --- crates/ra_hir_def/src/nameres.rs | 4 ++-- crates/ra_hir_def/src/nameres/mod_resolution.rs | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs index 433bdde48..55a747ee2 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/ra_hir_def/src/nameres.rs @@ -50,8 +50,8 @@ // FIXME: review privacy of submodules pub mod raw; pub mod per_ns; -pub mod collector; -pub mod mod_resolution; +mod collector; +mod mod_resolution; #[cfg(test)] mod tests; diff --git a/crates/ra_hir_def/src/nameres/mod_resolution.rs b/crates/ra_hir_def/src/nameres/mod_resolution.rs index f6b0b8fb1..b3b1379d0 100644 --- a/crates/ra_hir_def/src/nameres/mod_resolution.rs +++ b/crates/ra_hir_def/src/nameres/mod_resolution.rs @@ -6,7 +6,7 @@ use ra_syntax::SmolStr; use crate::{db::DefDatabase2, HirFileId}; #[derive(Clone, Debug)] -pub struct ModDir { +pub(super) struct ModDir { /// `.` for `mod.rs`, `lib.rs` /// `./foo` for `foo.rs` /// `./foo/bar` for `mod bar { mod x; }` nested in `foo.rs` @@ -16,11 +16,15 @@ pub struct ModDir { } impl ModDir { - pub fn root() -> ModDir { + pub(super) fn root() -> ModDir { ModDir { path: RelativePathBuf::default(), root_non_dir_owner: false } } - pub fn descend_into_definition(&self, name: &Name, attr_path: Option<&SmolStr>) -> ModDir { + pub(super) fn descend_into_definition( + &self, + name: &Name, + attr_path: Option<&SmolStr>, + ) -> ModDir { let mut path = self.path.clone(); match attr_to_path(attr_path) { None => path.push(&name.to_string()), @@ -34,7 +38,7 @@ impl ModDir { ModDir { path, root_non_dir_owner: false } } - pub fn resolve_declaration( + pub(super) fn resolve_declaration( &self, db: &impl DefDatabase2, file_id: HirFileId, -- cgit v1.2.3