Use custom implementation of read_buf in Read for &'a FileDesc

This allows to skip an unnecessary buffer initialization.
This commit is contained in:
Tomasz Miąsko 2023-02-19 00:00:00 +00:00
parent eebdfb55fc
commit b118569268

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 {