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 <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-08-09 17:50:27 +03:00 committed by tazjin
parent 56caaf70ca
commit 2dcbbb8c4a

View file

@ -8,7 +8,13 @@ pub struct NixList(pub Vec<Value>);
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!("<list({})>", self.0.len()))
f.write_str("[ ")?;
for v in &self.0 {
v.fmt(f)?;
f.write_str(" ")?;
}
f.write_str("]")
}
}