We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 338a2c0 commit c869638Copy full SHA for c869638
src/libstd/io/buffered.rs
@@ -727,6 +727,10 @@ impl<W: Write> Write for BufWriter<W> {
727
}
728
729
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
730
+ // Normally, `write_all` just calls `write` in a loop. We can do better
731
+ // by calling `self.get_mut().write_all()` directly, which avoids
732
+ // round trips through the buffer in the event of a series of partial
733
+ // writes.
734
if self.buf.len() + buf.len() > self.buf.capacity() {
735
self.flush_buf()?;
736
0 commit comments