flush writer, makes partial deserialization a bit less likely

This commit is contained in:
Rob Walker 2018-07-18 22:30:49 -07:00
parent b2ea2455e2
commit 0696f9f497
1 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,8 @@ impl<'a, W: Write> EntryWriter<'a, W> {
fn write_entry(writer: &mut W, entry: &Entry) -> io::Result<()> {
let serialized = serde_json::to_string(entry).unwrap();
writeln!(writer, "{}", serialized)
writeln!(writer, "{}", serialized)?;
writer.flush()
}
pub fn write_entries<I>(writer: &mut W, entries: I) -> io::Result<()>