Simplify pretty printing separated elements
This commit is contained in:
parent
9d6cd580d4
commit
6eee1ba930
5 changed files with 24 additions and 20 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue