From 030e540ad19046e2037981ec8e15a6800b86bbe9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 20 Dec 2019 15:51:43 +0100 Subject: Reduce visibility --- crates/ra_hir_def/src/item_scope.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/item_scope.rs b/crates/ra_hir_def/src/item_scope.rs index 62c878313..996d06db6 100644 --- a/crates/ra_hir_def/src/item_scope.rs +++ b/crates/ra_hir_def/src/item_scope.rs @@ -36,7 +36,7 @@ static BUILTIN_SCOPE: Lazy> = Lazy::new(|| { /// Shadow mode for builtin type which can be shadowed by module. #[derive(Debug, Copy, Clone, PartialEq, Eq)] -pub enum BuiltinShadowMode { +pub(crate) enum BuiltinShadowMode { // Prefer Module Module, // Prefer Other Types @@ -60,19 +60,19 @@ impl ItemScope { } /// Iterate over all module scoped macros - pub fn macros<'a>(&'a self) -> impl Iterator + 'a { + pub(crate) fn macros<'a>(&'a self) -> impl Iterator + 'a { self.items .iter() .filter_map(|(name, res)| res.def.take_macros().map(|macro_| (name, macro_))) } - /// Iterate over all legacy textual scoped macros visable at the end of the module - pub fn legacy_macros<'a>(&'a self) -> impl Iterator + 'a { + /// Iterate over all legacy textual scoped macros visible at the end of the module + pub(crate) fn legacy_macros<'a>(&'a self) -> impl Iterator + 'a { self.legacy_macros.iter().map(|(name, def)| (name, *def)) } /// Get a name from current module scope, legacy macros are not included - pub fn get(&self, name: &Name, shadow: BuiltinShadowMode) -> Option<&Resolution> { + pub(crate) fn get(&self, name: &Name, shadow: BuiltinShadowMode) -> Option<&Resolution> { match shadow { BuiltinShadowMode::Module => self.items.get(name).or_else(|| BUILTIN_SCOPE.get(name)), BuiltinShadowMode::Other => { @@ -88,7 +88,7 @@ impl ItemScope { } } - pub fn traits<'a>(&'a self) -> impl Iterator + 'a { + pub(crate) fn traits<'a>(&'a self) -> impl Iterator + 'a { self.items.values().filter_map(|r| match r.def.take_types() { Some(ModuleDefId::TraitId(t)) => Some(t), _ => None, -- cgit v1.2.3