From 733b535e983edd5b73f92ec1054b9717ba9db62c Mon Sep 17 00:00:00 2001 From: Neo Date: Tue, 26 Dec 2023 09:15:52 +0100 Subject: [PATCH] fix display trait --- runner/src/ast.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/runner/src/ast.rs b/runner/src/ast.rs index a58e06c22..9085ee2dc 100644 --- a/runner/src/ast.rs +++ b/runner/src/ast.rs @@ -13,7 +13,20 @@ impl Display for Expr { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Expr::Value(v) => write!(f, "{v}"), - Expr::Array(v) => write!(f, "{v:?}"), + Expr::Array(v) => { + write!(f, "[")?; + + for (i, expr) in v.iter().enumerate() { + if i != 0 { + write!(f, ", ")?; + } + write!(f, "{expr}")?; + } + + write!(f, "]")?; + + Ok(()) + }, } } }