From 29832b8c3db509dea8da9164e980ccac4bccf47d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 16 Jul 2020 18:07:53 +0200 Subject: Reduce visibility --- crates/ra_ide/src/display/function_signature.rs | 40 ++++++++++++------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'crates/ra_ide/src/display') diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index 709a85f65..9b7220d1f 100644 --- a/crates/ra_ide/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs @@ -15,49 +15,48 @@ use stdx::{split_delim, SepBy}; use crate::display::{generic_parameters, where_predicates}; #[derive(Debug)] -pub enum CallableKind { +pub(crate) enum CallableKind { Function, StructConstructor, VariantConstructor, - Macro, } /// Contains information about a function signature #[derive(Debug)] -pub struct FunctionSignature { - pub kind: CallableKind, +pub(crate) struct FunctionSignature { + pub(crate) kind: CallableKind, /// Optional visibility - pub visibility: Option, + pub(crate) visibility: Option, /// Qualifiers like `async`, `unsafe`, ... - pub qualifier: FunctionQualifier, + pub(crate) qualifier: FunctionQualifier, /// Name of the function - pub name: Option, + pub(crate) name: Option, /// Documentation for the function - pub doc: Option, + pub(crate) doc: Option, /// Generic parameters - pub generic_parameters: Vec, + pub(crate) generic_parameters: Vec, /// Parameters of the function - pub parameters: Vec, + pub(crate) parameters: Vec, /// Parameter names of the function - pub parameter_names: Vec, + pub(crate) parameter_names: Vec, /// Parameter types of the function - pub parameter_types: Vec, + pub(crate) parameter_types: Vec, /// Optional return type - pub ret_type: Option, + pub(crate) ret_type: Option, /// Where predicates - pub where_predicates: Vec, + pub(crate) where_predicates: Vec, /// Self param presence - pub has_self_param: bool, + pub(crate) has_self_param: bool, } #[derive(Debug, Default)] -pub struct FunctionQualifier { +pub(crate) struct FunctionQualifier { // `async` and `const` are mutually exclusive. Do we need to enforcing it here? - pub is_async: bool, - pub is_const: bool, - pub is_unsafe: bool, + pub(crate) is_async: bool, + pub(crate) is_const: bool, + pub(crate) is_unsafe: bool, /// The string `extern ".."` - pub extern_abi: Option, + pub(crate) extern_abi: Option, } impl FunctionSignature { @@ -277,7 +276,6 @@ impl Display for FunctionSignature { CallableKind::Function => write!(f, "fn {}", name)?, CallableKind::StructConstructor => write!(f, "struct {}", name)?, CallableKind::VariantConstructor => write!(f, "{}", name)?, - CallableKind::Macro => write!(f, "{}!", name)?, } } -- cgit v1.2.3