diff options
| author | Nick Cameron <nrc@ncameron.org> | 2022-06-07 08:43:54 +0100 |
|---|---|---|
| committer | Nick Cameron <nrc@ncameron.org> | 2022-08-05 17:18:51 +0100 |
| commit | 1a2122fff015d1d7fb31fe3a55e49027d67d79af (patch) | |
| tree | 374f8a15ec2b3e0c8a61f25bebdb5122c265041e /library/std/src/io/copy.rs | |
| parent | b56cf67ce14580111ffb07a08a293e217566e116 (diff) | |
| download | rust-1a2122fff015d1d7fb31fe3a55e49027d67d79af.tar.gz rust-1a2122fff015d1d7fb31fe3a55e49027d67d79af.zip | |
non-linux platforms
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Diffstat (limited to 'library/std/src/io/copy.rs')
| -rw-r--r-- | library/std/src/io/copy.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/io/copy.rs b/library/std/src/io/copy.rs index 193bcd47467..1efd98b92aa 100644 --- a/library/std/src/io/copy.rs +++ b/library/std/src/io/copy.rs @@ -1,4 +1,4 @@ -use super::{BorrowBuf, BufWriter, ErrorKind, Read, Result, Write, DEFAULT_BUF_SIZE}; +use super::{BorrowedBuf, BufWriter, ErrorKind, Read, Result, Write, DEFAULT_BUF_SIZE}; use crate::mem::MaybeUninit; /// Copies the entire contents of a reader into a writer. @@ -97,7 +97,7 @@ impl<I: Write> BufferedCopySpec for BufWriter<I> { loop { let buf = writer.buffer_mut(); - let mut read_buf: BorrowBuf<'_> = buf.spare_capacity_mut().into(); + let mut read_buf: BorrowedBuf<'_> = buf.spare_capacity_mut().into(); unsafe { // SAFETY: init is either 0 or the init_len from the previous iteration. @@ -117,7 +117,7 @@ impl<I: Write> BufferedCopySpec for BufWriter<I> { init = read_buf.init_len() - bytes_read; len += bytes_read as u64; - // SAFETY: BorrowBuf guarantees all of its filled bytes are init + // SAFETY: BorrowedBuf guarantees all of its filled bytes are init unsafe { buf.set_len(buf.len() + bytes_read) }; // Read again if the buffer still has enough capacity, as BufWriter itself would do @@ -139,7 +139,7 @@ fn stack_buffer_copy<R: Read + ?Sized, W: Write + ?Sized>( writer: &mut W, ) -> Result<u64> { let buf: &mut [_] = &mut [MaybeUninit::uninit(); DEFAULT_BUF_SIZE]; - let mut buf: BorrowBuf<'_> = buf.into(); + let mut buf: BorrowedBuf<'_> = buf.into(); let mut len = 0; |
