Ensure that encoded output ends with a newline

This commit is contained in:
Nathan Fisher 2025-01-11 10:50:09 -05:00
parent 903d516af8
commit 23228d7090
2 changed files with 6 additions and 1 deletions

View file

@ -62,6 +62,11 @@ impl<R: Read, W: Write> Encoder<R, W> {
break; break;
} }
if n_bytes == 0 { if n_bytes == 0 {
if let Some(wrap) = self.wrap {
if total % wrap != 0 {
writeln!(self.writer)?;
}
}
break; break;
} }
for (idx, n) in ibuf.iter().enumerate() { for (idx, n) in ibuf.iter().enumerate() {