fix: use write! for diffs, writeln! produces extraneous lines

This commit is contained in:
Blair Noctis 2023-12-21 00:04:30 +08:00
parent e6425e996d
commit 320bebd9d5
No known key found for this signature in database
GPG key ID: 2C89AF5FFD1C767C

View file

@ -94,7 +94,7 @@ fn try_main() -> Result<()> {
Source::File(path) => Some(path.as_path()),
};
// TODO: custom context radius
writeln!(handle, "{}", create_udiff(mmap, replaced, 3, path)?)?;
write!(handle, "{}", create_udiff(mmap, replaced, 3, path)?)?;
}
} else {
// Windows requires closing mmap before writing: