Add Read::initializer.
This is an API that allows types to indicate that they can be passed buffers of uninitialized memory which can improve performance.
This commit is contained in:
@@ -25,13 +25,6 @@ impl Stdin {
|
||||
fd.into_raw();
|
||||
ret
|
||||
}
|
||||
|
||||
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
|
||||
let fd = FileDesc::new(libc::STDIN_FILENO);
|
||||
let ret = fd.read_to_end(buf);
|
||||
fd.into_raw();
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
impl Stdout {
|
||||
|
||||
Reference in New Issue
Block a user