From 2dcbbb8c4a737483fcd2133411ef425299a741fd Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 9 Aug 2022 17:50:27 +0300 Subject: feat(tvix/value): implement Display properly for lists Change-Id: I991d235cf52fbd42eb839b384f9c55ee64fa86c4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6100 Tested-by: BuildkiteCI Reviewed-by: grfn --- tvix/eval/src/value/list.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tvix/eval/src/value/list.rs b/tvix/eval/src/value/list.rs index 08f56262e0..d5f7c8b2ba 100644 --- a/tvix/eval/src/value/list.rs +++ b/tvix/eval/src/value/list.rs @@ -8,7 +8,13 @@ pub struct NixList(pub Vec); impl Display for NixList { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - // TODO(tazjin): format lists properly - f.write_fmt(format_args!("", self.0.len())) + f.write_str("[ ")?; + + for v in &self.0 { + v.fmt(f)?; + f.write_str(" ")?; + } + + f.write_str("]") } } -- cgit 1.4.1