cl-ast: Let Ty handle the complexities of VariantKind::Tuple's type list

This commit is contained in:
2024-04-16 20:40:02 -05:00
parent 98868d3960
commit 83694988c3
3 changed files with 11 additions and 7 deletions

View File

@@ -251,7 +251,7 @@ mod display {
match self {
VariantKind::Plain => Ok(()),
VariantKind::CLike(n) => write!(f, " = {n}"),
VariantKind::Tuple(v) => delimit(separate(v, ", "), INLINE_PARENS)(f),
VariantKind::Tuple(v) => v.fmt(f),
VariantKind::Struct(v) => delimit(separate(v, ", "), INLINE_BRACES)(f),
}
}

View File

@@ -197,7 +197,7 @@ pub struct Variant {
pub enum VariantKind {
Plain,
CLike(u128),
Tuple(Vec<Ty>),
Tuple(Ty),
Struct(Vec<StructMember>),
}