From 64f202bdd7f74b081e08f2b5faee4bd91c9b44a8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 15:32:27 +0300 Subject: move variant public api to api --- crates/ra_hir/src/adt.rs | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'crates/ra_hir/src/adt.rs') diff --git a/crates/ra_hir/src/adt.rs b/crates/ra_hir/src/adt.rs index 58deea1c7..d56570754 100644 --- a/crates/ra_hir/src/adt.rs +++ b/crates/ra_hir/src/adt.rs @@ -26,14 +26,6 @@ impl StructData { let variant_data = Arc::new(variant_data); StructData { name, variant_data } } - - pub fn name(&self) -> Option<&Name> { - self.name.as_ref() - } - - pub fn variant_data(&self) -> &Arc { - &self.variant_data - } } impl Enum { @@ -68,7 +60,7 @@ impl EnumData { } impl VariantData { - pub fn new(flavor: StructFlavor) -> Self { + pub(crate) fn new(flavor: StructFlavor) -> Self { match flavor { StructFlavor::Tuple(fl) => { let fields = fl @@ -101,29 +93,4 @@ impl VariantData { .find(|f| f.name() == field_name) .map(|f| f.type_ref()) } - - pub fn fields(&self) -> &[StructField] { - match *self { - VariantData::Struct(ref fields) | VariantData::Tuple(ref fields) => fields, - _ => &[], - } - } - pub fn is_struct(&self) -> bool { - match self { - VariantData::Struct(..) => true, - _ => false, - } - } - pub fn is_tuple(&self) -> bool { - match self { - VariantData::Tuple(..) => true, - _ => false, - } - } - pub fn is_unit(&self) -> bool { - match self { - VariantData::Unit => true, - _ => false, - } - } } -- cgit v1.2.3