Skip to content

Commit

Permalink
Rollup merge of rust-lang#123084 - a1phyr:unixstream_read_buf, r=work…
Browse files Browse the repository at this point in the history
…ingjubilee

`UnixStream`: override `read_buf`

Split from rust-lang#122441

r? `@workingjubilee`
  • Loading branch information
workingjubilee authored Mar 26, 2024
2 parents c9393df + bff13e9 commit 9bebf31
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/std/src/os/unix/net/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@ impl io::Read for UnixStream {
io::Read::read(&mut &*self, buf)
}

fn read_buf(&mut self, buf: io::BorrowedCursor<'_>) -> io::Result<()> {
io::Read::read_buf(&mut &*self, buf)
}

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
io::Read::read_vectored(&mut &*self, bufs)
}
Expand All @@ -596,6 +600,10 @@ impl<'a> io::Read for &'a UnixStream {
self.0.read(buf)
}

fn read_buf(&mut self, buf: io::BorrowedCursor<'_>) -> io::Result<()> {
self.0.read_buf(buf)
}

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
self.0.read_vectored(bufs)
}
Expand Down

0 comments on commit 9bebf31

Please sign in to comment.