cl-ast: Separate Display impl for Ty and TyKind

This commit is contained in:
John 2024-04-14 23:10:02 -05:00
parent 489a1f7944
commit d07a3e1455

View File

@ -255,7 +255,12 @@ mod display {
impl Display for Ty { impl Display for Ty {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind { self.kind.fmt(f)
}
}
impl Display for TyKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
TyKind::Never => "!".fmt(f), TyKind::Never => "!".fmt(f),
TyKind::Empty => "()".fmt(f), TyKind::Empty => "()".fmt(f),
TyKind::SelfTy => "Self".fmt(f), TyKind::SelfTy => "Self".fmt(f),