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.
This commit is contained in:
bors
2023-02-20 03:49:04 +00:00
+4
View File
@@ -284,6 +284,10 @@ impl<'a> Read for &'a FileDesc {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
(**self).read(buf)
}
fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> {
(**self).read_buf(cursor)
}
}
impl AsInner<OwnedFd> for FileDesc {