From 7022ea52b5f2a0262c2cd96b290ddb8ec0af0df9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 7 Feb 2021 14:15:02 +0300 Subject: AdtDef -> Adt --- crates/syntax/src/ast/generated/nodes.rs | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'crates/syntax') diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs index 5baa54a3f..064931aec 100644 --- a/crates/syntax/src/ast/generated/nodes.rs +++ b/crates/syntax/src/ast/generated/nodes.rs @@ -1401,15 +1401,15 @@ pub enum FieldList { TupleFieldList(TupleFieldList), } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum AdtDef { +pub enum Adt { Enum(Enum), Struct(Struct), Union(Union), } -impl ast::AttrsOwner for AdtDef {} -impl ast::GenericParamsOwner for AdtDef {} -impl ast::NameOwner for AdtDef {} -impl ast::VisibilityOwner for AdtDef {} +impl ast::AttrsOwner for Adt {} +impl ast::GenericParamsOwner for Adt {} +impl ast::NameOwner for Adt {} +impl ast::VisibilityOwner for Adt {} #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum AssocItem { Const(Const), @@ -3394,16 +3394,16 @@ impl AstNode for FieldList { } } } -impl From for AdtDef { - fn from(node: Enum) -> AdtDef { AdtDef::Enum(node) } +impl From for Adt { + fn from(node: Enum) -> Adt { Adt::Enum(node) } } -impl From for AdtDef { - fn from(node: Struct) -> AdtDef { AdtDef::Struct(node) } +impl From for Adt { + fn from(node: Struct) -> Adt { Adt::Struct(node) } } -impl From for AdtDef { - fn from(node: Union) -> AdtDef { AdtDef::Union(node) } +impl From for Adt { + fn from(node: Union) -> Adt { Adt::Union(node) } } -impl AstNode for AdtDef { +impl AstNode for Adt { fn can_cast(kind: SyntaxKind) -> bool { match kind { ENUM | STRUCT | UNION => true, @@ -3412,18 +3412,18 @@ impl AstNode for AdtDef { } fn cast(syntax: SyntaxNode) -> Option { let res = match syntax.kind() { - ENUM => AdtDef::Enum(Enum { syntax }), - STRUCT => AdtDef::Struct(Struct { syntax }), - UNION => AdtDef::Union(Union { syntax }), + ENUM => Adt::Enum(Enum { syntax }), + STRUCT => Adt::Struct(Struct { syntax }), + UNION => Adt::Union(Union { syntax }), _ => return None, }; Some(res) } fn syntax(&self) -> &SyntaxNode { match self { - AdtDef::Enum(it) => &it.syntax, - AdtDef::Struct(it) => &it.syntax, - AdtDef::Union(it) => &it.syntax, + Adt::Enum(it) => &it.syntax, + Adt::Struct(it) => &it.syntax, + Adt::Union(it) => &it.syntax, } } } @@ -3571,7 +3571,7 @@ impl std::fmt::Display for FieldList { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for AdtDef { +impl std::fmt::Display for Adt { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } -- cgit v1.2.3