Skip to content

Commit 7c5a895

Browse files
committed
fix test failure from trying to assume_init too much
1 parent 9562c01 commit 7c5a895

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/io/copy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<I: Write> BufferedCopySpec for BufWriter<I> {
103103
return Ok(len);
104104
}
105105

106-
init = read_buf.initialized_len();
106+
init = read_buf.initialized_len() - bytes_read;
107107

108108
// SAFETY: ReadBuf guarantees all of its filled bytes are init
109109
unsafe { buf.set_len(buf.len() + bytes_read) };

0 commit comments

Comments
 (0)