From 76202a2c7371a6930db7b83af75c0f5a8ae1d061 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 Jul 2020 19:22:15 +0200 Subject: Rename NomialDef -> AdtDef --- crates/ra_syntax/src/ast/generated/nodes.rs | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index b2d108a7c..04a4d354c 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -1376,15 +1376,15 @@ impl ast::AttrsOwner for ExternItem {} impl ast::NameOwner for ExternItem {} impl ast::VisibilityOwner for ExternItem {} #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum NominalDef { +pub enum AdtDef { StructDef(StructDef), EnumDef(EnumDef), UnionDef(UnionDef), } -impl ast::AttrsOwner for NominalDef {} -impl ast::NameOwner for NominalDef {} -impl ast::TypeParamsOwner for NominalDef {} -impl ast::VisibilityOwner for NominalDef {} +impl ast::AttrsOwner for AdtDef {} +impl ast::NameOwner for AdtDef {} +impl ast::TypeParamsOwner for AdtDef {} +impl ast::VisibilityOwner for AdtDef {} impl AstNode for SourceFile { fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE } fn cast(syntax: SyntaxNode) -> Option { @@ -3345,16 +3345,16 @@ impl AstNode for ExternItem { } } } -impl From for NominalDef { - fn from(node: StructDef) -> NominalDef { NominalDef::StructDef(node) } +impl From for AdtDef { + fn from(node: StructDef) -> AdtDef { AdtDef::StructDef(node) } } -impl From for NominalDef { - fn from(node: EnumDef) -> NominalDef { NominalDef::EnumDef(node) } +impl From for AdtDef { + fn from(node: EnumDef) -> AdtDef { AdtDef::EnumDef(node) } } -impl From for NominalDef { - fn from(node: UnionDef) -> NominalDef { NominalDef::UnionDef(node) } +impl From for AdtDef { + fn from(node: UnionDef) -> AdtDef { AdtDef::UnionDef(node) } } -impl AstNode for NominalDef { +impl AstNode for AdtDef { fn can_cast(kind: SyntaxKind) -> bool { match kind { STRUCT_DEF | ENUM_DEF | UNION_DEF => true, @@ -3363,18 +3363,18 @@ impl AstNode for NominalDef { } fn cast(syntax: SyntaxNode) -> Option { let res = match syntax.kind() { - STRUCT_DEF => NominalDef::StructDef(StructDef { syntax }), - ENUM_DEF => NominalDef::EnumDef(EnumDef { syntax }), - UNION_DEF => NominalDef::UnionDef(UnionDef { syntax }), + STRUCT_DEF => AdtDef::StructDef(StructDef { syntax }), + ENUM_DEF => AdtDef::EnumDef(EnumDef { syntax }), + UNION_DEF => AdtDef::UnionDef(UnionDef { syntax }), _ => return None, }; Some(res) } fn syntax(&self) -> &SyntaxNode { match self { - NominalDef::StructDef(it) => &it.syntax, - NominalDef::EnumDef(it) => &it.syntax, - NominalDef::UnionDef(it) => &it.syntax, + AdtDef::StructDef(it) => &it.syntax, + AdtDef::EnumDef(it) => &it.syntax, + AdtDef::UnionDef(it) => &it.syntax, } } } @@ -3423,7 +3423,7 @@ impl std::fmt::Display for ExternItem { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for NominalDef { +impl std::fmt::Display for AdtDef { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } -- cgit v1.2.3