diff --git a/src/fmt/writer/mod.rs b/src/fmt/writer/mod.rs index fa7ce1f..ba0ec7e 100644 --- a/src/fmt/writer/mod.rs +++ b/src/fmt/writer/mod.rs @@ -69,17 +69,20 @@ impl WritableTarget { WritableTarget::WriteStdout => { let mut stream = std::io::stdout().lock(); stream.write_all(buf)?; + stream.flush()?; } WritableTarget::PrintStdout => print!("{}", String::from_utf8_lossy(buf)), WritableTarget::WriteStderr => { let mut stream = std::io::stderr().lock(); stream.write_all(buf)?; + stream.flush()?; } WritableTarget::PrintStderr => eprint!("{}", String::from_utf8_lossy(buf)), // Safety: If the target type is `Pipe`, `target_pipe` will always be non-empty. WritableTarget::Pipe(pipe) => { let mut stream = pipe.lock().unwrap(); stream.write_all(buf)?; + stream.flush()?; } }