Use custom implementation of read_buf in Read for &'a FileDesc
This allows to skip an unnecessary buffer initialization.
This commit is contained in:
parent
eebdfb55fc
commit
b118569268
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user