From dc5e5f610cf057654bce9d8fcf275ae375299f90 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 8 Nov 2019 23:47:52 +0300 Subject: Reduce visibility --- crates/ra_hir_def/src/nameres/raw.rs | 46 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/nameres/raw.rs b/crates/ra_hir_def/src/nameres/raw.rs index cb47fa317..bad67d409 100644 --- a/crates/ra_hir_def/src/nameres/raw.rs +++ b/crates/ra_hir_def/src/nameres/raw.rs @@ -88,7 +88,7 @@ impl RawItems { (Arc::new(collector.raw_items), Arc::new(collector.source_map)) } - pub fn items(&self) -> &[RawItem] { + pub(super) fn items(&self) -> &[RawItem] { &self.items } } @@ -127,17 +127,17 @@ type Attrs = Option>; #[derive(Debug, PartialEq, Eq, Clone)] pub struct RawItem { attrs: Attrs, - pub kind: RawItemKind, + pub(super) kind: RawItemKind, } impl RawItem { - pub fn attrs(&self) -> &[Attr] { + pub(super) fn attrs(&self) -> &[Attr] { self.attrs.as_ref().map_or(&[], |it| &*it) } } #[derive(Debug, PartialEq, Eq, Clone, Copy)] -pub enum RawItemKind { +pub(crate) enum RawItemKind { Module(Module), Import(ImportId), Def(Def), @@ -145,11 +145,11 @@ pub enum RawItemKind { } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct Module(RawId); +pub(crate) struct Module(RawId); impl_arena_id!(Module); #[derive(Debug, PartialEq, Eq)] -pub enum ModuleData { +pub(crate) enum ModuleData { Declaration { name: Name, ast_id: FileAstId }, Definition { name: Name, ast_id: FileAstId, items: Vec }, } @@ -160,26 +160,26 @@ impl_arena_id!(ImportId); #[derive(Debug, Clone, PartialEq, Eq)] pub struct ImportData { - pub path: Path, - pub alias: Option, - pub is_glob: bool, - pub is_prelude: bool, - pub is_extern_crate: bool, - pub is_macro_use: bool, + pub(super) path: Path, + pub(super) alias: Option, + pub(super) is_glob: bool, + pub(super) is_prelude: bool, + pub(super) is_extern_crate: bool, + pub(super) is_macro_use: bool, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct Def(RawId); +pub(crate) struct Def(RawId); impl_arena_id!(Def); #[derive(Debug, PartialEq, Eq)] -pub struct DefData { - pub name: Name, - pub kind: DefKind, +pub(crate) struct DefData { + pub(super) name: Name, + pub(super) kind: DefKind, } #[derive(Debug, PartialEq, Eq, Clone, Copy)] -pub enum DefKind { +pub(crate) enum DefKind { Function(FileAstId), Struct(FileAstId), Union(FileAstId), @@ -191,15 +191,15 @@ pub enum DefKind { } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct Macro(RawId); +pub(crate) struct Macro(RawId); impl_arena_id!(Macro); #[derive(Debug, PartialEq, Eq)] -pub struct MacroData { - pub ast_id: FileAstId, - pub path: Path, - pub name: Option, - pub export: bool, +pub(crate) struct MacroData { + pub(super) ast_id: FileAstId, + pub(super) path: Path, + pub(super) name: Option, + pub(super) export: bool, } struct RawItemsCollector { -- cgit v1.2.3