This commit is contained in:
Daniel Eades 2023-01-10 19:51:21 +00:00
parent 5b1cd8245f
commit 95fc3ba41c

View File

@ -113,7 +113,7 @@ impl<'a> Printer<'a> {
}
fn newline(&mut self) {
match self.buf.chars().rev().skip_while(|ch| *ch == ' ').next() {
match self.buf.chars().rev().find(|ch| *ch != ' ') {
Some('\n') | None => {}
_ => writeln!(self).unwrap(),
}