2174: Reduce visibility r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2019-11-04 18:42:55 +00:00 committed by GitHub
commit 7c0d7d3838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -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;

View File

@ -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,