fix test failure from trying to assume_init too much

This commit is contained in:
DrMeepster 2021-06-29 15:25:08 -07:00
parent 9562c01879
commit 7c5a895a89

View File

@ -103,7 +103,7 @@ impl<I: Write> BufferedCopySpec for BufWriter<I> {
return Ok(len); return Ok(len);
} }
init = read_buf.initialized_len(); init = read_buf.initialized_len() - bytes_read;
// SAFETY: ReadBuf guarantees all of its filled bytes are init // SAFETY: ReadBuf guarantees all of its filled bytes are init
unsafe { buf.set_len(buf.len() + bytes_read) }; unsafe { buf.set_len(buf.len() + bytes_read) };