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:
parent
56caaf70ca
commit
2dcbbb8c4a
1 changed files with 8 additions and 2 deletions
|
@ -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("]")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue