aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-29 18:40:56 +0100
committerGitHub <[email protected]>2020-07-29 18:40:56 +0100
commit17126b9827dcec89bbe07add455a4ad893db58fa (patch)
tree9b355311e2b9261c125f2c3a2a0f205b9d8e5da7 /crates/ra_syntax
parent2dfda0b984c45946b9a4148bd848350deac544f2 (diff)
parent76202a2c7371a6930db7b83af75c0f5a8ae1d061 (diff)
Merge #5573
5573: Rename NomialDef -> AdtDef r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs38
1 files changed, 19 insertions, 19 deletions
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 {}
1376impl ast::NameOwner for ExternItem {} 1376impl ast::NameOwner for ExternItem {}
1377impl ast::VisibilityOwner for ExternItem {} 1377impl ast::VisibilityOwner for ExternItem {}
1378#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1378#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1379pub enum NominalDef { 1379pub enum AdtDef {
1380 StructDef(StructDef), 1380 StructDef(StructDef),
1381 EnumDef(EnumDef), 1381 EnumDef(EnumDef),
1382 UnionDef(UnionDef), 1382 UnionDef(UnionDef),
1383} 1383}
1384impl ast::AttrsOwner for NominalDef {} 1384impl ast::AttrsOwner for AdtDef {}
1385impl ast::NameOwner for NominalDef {} 1385impl ast::NameOwner for AdtDef {}
1386impl ast::TypeParamsOwner for NominalDef {} 1386impl ast::TypeParamsOwner for AdtDef {}
1387impl ast::VisibilityOwner for NominalDef {} 1387impl ast::VisibilityOwner for AdtDef {}
1388impl AstNode for SourceFile { 1388impl AstNode for SourceFile {
1389 fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE } 1389 fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE }
1390 fn cast(syntax: SyntaxNode) -> Option<Self> { 1390 fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -3345,16 +3345,16 @@ impl AstNode for ExternItem {
3345 } 3345 }
3346 } 3346 }
3347} 3347}
3348impl From<StructDef> for NominalDef { 3348impl From<StructDef> for AdtDef {
3349 fn from(node: StructDef) -> NominalDef { NominalDef::StructDef(node) } 3349 fn from(node: StructDef) -> AdtDef { AdtDef::StructDef(node) }
3350} 3350}
3351impl From<EnumDef> for NominalDef { 3351impl From<EnumDef> for AdtDef {
3352 fn from(node: EnumDef) -> NominalDef { NominalDef::EnumDef(node) } 3352 fn from(node: EnumDef) -> AdtDef { AdtDef::EnumDef(node) }
3353} 3353}
3354impl From<UnionDef> for NominalDef { 3354impl From<UnionDef> for AdtDef {
3355 fn from(node: UnionDef) -> NominalDef { NominalDef::UnionDef(node) } 3355 fn from(node: UnionDef) -> AdtDef { AdtDef::UnionDef(node) }
3356} 3356}
3357impl AstNode for NominalDef { 3357impl AstNode for AdtDef {
3358 fn can_cast(kind: SyntaxKind) -> bool { 3358 fn can_cast(kind: SyntaxKind) -> bool {
3359 match kind { 3359 match kind {
3360 STRUCT_DEF | ENUM_DEF | UNION_DEF => true, 3360 STRUCT_DEF | ENUM_DEF | UNION_DEF => true,
@@ -3363,18 +3363,18 @@ impl AstNode for NominalDef {
3363 } 3363 }
3364 fn cast(syntax: SyntaxNode) -> Option<Self> { 3364 fn cast(syntax: SyntaxNode) -> Option<Self> {
3365 let res = match syntax.kind() { 3365 let res = match syntax.kind() {
3366 STRUCT_DEF => NominalDef::StructDef(StructDef { syntax }), 3366 STRUCT_DEF => AdtDef::StructDef(StructDef { syntax }),
3367 ENUM_DEF => NominalDef::EnumDef(EnumDef { syntax }), 3367 ENUM_DEF => AdtDef::EnumDef(EnumDef { syntax }),
3368 UNION_DEF => NominalDef::UnionDef(UnionDef { syntax }), 3368 UNION_DEF => AdtDef::UnionDef(UnionDef { syntax }),
3369 _ => return None, 3369 _ => return None,
3370 }; 3370 };
3371 Some(res) 3371 Some(res)
3372 } 3372 }
3373 fn syntax(&self) -> &SyntaxNode { 3373 fn syntax(&self) -> &SyntaxNode {
3374 match self { 3374 match self {
3375 NominalDef::StructDef(it) => &it.syntax, 3375 AdtDef::StructDef(it) => &it.syntax,
3376 NominalDef::EnumDef(it) => &it.syntax, 3376 AdtDef::EnumDef(it) => &it.syntax,
3377 NominalDef::UnionDef(it) => &it.syntax, 3377 AdtDef::UnionDef(it) => &it.syntax,
3378 } 3378 }
3379 } 3379 }
3380} 3380}
@@ -3423,7 +3423,7 @@ impl std::fmt::Display for ExternItem {
3423 std::fmt::Display::fmt(self.syntax(), f) 3423 std::fmt::Display::fmt(self.syntax(), f)
3424 } 3424 }
3425} 3425}
3426impl std::fmt::Display for NominalDef { 3426impl std::fmt::Display for AdtDef {
3427 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3427 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3428 std::fmt::Display::fmt(self.syntax(), f) 3428 std::fmt::Display::fmt(self.syntax(), f)
3429 } 3429 }