Skip to content

Commit 824f915

Browse files
committed
Auto merge of #108235 - tmiasko:read-buf, r=the8472
Use custom implementation of read_buf in Read for &'a FileDesc This allows to skip an unnecessary buffer initialization. Fixes #108223.
2 parents 7b55296 + b118569 commit 824f915

File tree

1 file changed

+4
-0
lines changed
  • library/std/src/sys/unix

1 file changed

+4
-0
lines changed

library/std/src/sys/unix/fd.rs

+4
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ impl<'a> Read for &'a FileDesc {
284284
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
285285
(**self).read(buf)
286286
}
287+
288+
fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> {
289+
(**self).read_buf(cursor)
290+
}
287291
}
288292

289293
impl AsInner<OwnedFd> for FileDesc {

0 commit comments

Comments
 (0)