1
Fork 0

Add read_to_end for AnonPipe

Add `read_to_end` method for `sys::{target}::pipe::AnonPipe`. This allows
having a more optimized version of `read_to_end` for ChildStdout.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
This commit is contained in:
Ayush Singh 2022-12-08 18:12:15 +05:30
parent f5418b09e8
commit 5479fe5f70
No known key found for this signature in database
GPG key ID: 05CEF5C789E55A74
4 changed files with 17 additions and 1 deletions

View file

@ -362,6 +362,10 @@ impl Read for ChildStdout {
fn is_read_vectored(&self) -> bool {
self.inner.is_read_vectored()
}
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> io::Result<usize> {
self.inner.read_to_end(buf)
}
}
impl AsInner<AnonPipe> for ChildStdout {