From 47e553667851bfcdda0317a27c8304dbc9797f32 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Jan 2019 12:46:23 +0300 Subject: rename struct field -> struct field data --- crates/ra_hir/src/adt.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ra_hir/src/adt.rs b/crates/ra_hir/src/adt.rs index dc936e826..2579ece19 100644 --- a/crates/ra_hir/src/adt.rs +++ b/crates/ra_hir/src/adt.rs @@ -118,7 +118,7 @@ pub struct EnumVariantData { /// A single field of an enum variant or struct #[derive(Debug, Clone, PartialEq, Eq)] -pub struct StructField { +pub struct StructFieldData { pub(crate) name: Name, pub(crate) type_ref: TypeRef, } @@ -126,13 +126,13 @@ pub struct StructField { /// Fields of an enum variant or struct #[derive(Debug, Clone, PartialEq, Eq)] pub enum VariantData { - Struct(Vec), - Tuple(Vec), + Struct(Vec), + Tuple(Vec), Unit, } impl VariantData { - pub fn fields(&self) -> &[StructField] { + pub fn fields(&self) -> &[StructFieldData] { match self { VariantData::Struct(fields) | VariantData::Tuple(fields) => fields, _ => &[], @@ -168,7 +168,7 @@ impl VariantData { let fields = fl .fields() .enumerate() - .map(|(i, fd)| StructField { + .map(|(i, fd)| StructFieldData { name: Name::tuple_field_name(i), type_ref: TypeRef::from_ast_opt(fd.type_ref()), }) @@ -178,7 +178,7 @@ impl VariantData { StructFlavor::Named(fl) => { let fields = fl .fields() - .map(|fd| StructField { + .map(|fd| StructFieldData { name: fd.name().map(|n| n.as_name()).unwrap_or_else(Name::missing), type_ref: TypeRef::from_ast_opt(fd.type_ref()), }) -- cgit v1.2.3