Uniformalize naming

This commit is contained in:
Aleksey Kladov 2019-11-22 21:52:06 +03:00
parent 4d49b5d174
commit d8caf56dfc
6 changed files with 17 additions and 22 deletions

View file

@ -178,15 +178,15 @@ impl ast::ImplBlock {
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum StructKind {
Record(ast::RecordFieldDefList),
Tuple(ast::TupleFieldDefList),
Named(ast::RecordFieldDefList),
Unit,
}
impl StructKind {
fn from_node<N: AstNode>(node: &N) -> StructKind {
if let Some(nfdl) = child_opt::<_, ast::RecordFieldDefList>(node) {
StructKind::Named(nfdl)
StructKind::Record(nfdl)
} else if let Some(pfl) = child_opt::<_, ast::TupleFieldDefList>(node) {
StructKind::Tuple(pfl)
} else {