flush writer, makes partial deserialization a bit less likely
This commit is contained in:
@ -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<()>
|
||||
|
Reference in New Issue
Block a user