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

@ -23,9 +23,9 @@ impl<'a, D: DocAllocator<'a>> Pretty<'a, D> for Program {
.append(allocator.line())
.append(elems.pretty(
allocator,
|a, e| e.pretty(a),
|a, (s0, s1)| a.text(",").append(a.line()),
|a, s| a.text(","),
|e| e.pretty(allocator),
|(s0, s1)| allocator.text(",").append(allocator.line()),
|s| allocator.text(","),
)),
}
}