From d07a3e14551e0d124afad080bb02aa2e6c38646f Mon Sep 17 00:00:00 2001 From: John Date: Sun, 14 Apr 2024 23:10:02 -0500 Subject: [PATCH] cl-ast: Separate Display impl for Ty and TyKind --- cl-ast/src/ast_impl.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cl-ast/src/ast_impl.rs b/cl-ast/src/ast_impl.rs index 960e56e..ca07eb8 100644 --- a/cl-ast/src/ast_impl.rs +++ b/cl-ast/src/ast_impl.rs @@ -255,7 +255,12 @@ mod display { impl Display for Ty { 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::Empty => "()".fmt(f), TyKind::SelfTy => "Self".fmt(f),