Simplify pretty printing separated elements

This commit is contained in:
Joscha 2022-11-21 00:20:33 +01:00
parent 9d6cd580d4
commit 6eee1ba930
5 changed files with 24 additions and 20 deletions

View file

@ -30,9 +30,9 @@ impl<'a, D: DocAllocator<'a>> Pretty<'a, D> for TableConstr {
self.elems
.pretty(
allocator,
|a, e| a.line().append(e.pretty(a)),
|a, (s0, s1)| a.text(","),
|a, s| a.text(","),
|e| allocator.line().append(e.pretty(allocator)),
|(s0, s1)| allocator.text(","),
|s| allocator.text(","),
)
.nest(NEST_DEPTH)
.append(allocator.line())