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:
@@ -243,10 +243,6 @@ impl TcpStream {
|
||||
self.inner.read(buf)
|
||||
}
|
||||
|
||||
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
|
||||
self.inner.read_to_end(buf)
|
||||
}
|
||||
|
||||
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
|
||||
let len = cmp::min(buf.len(), <wrlen_t>::max_value() as usize) as wrlen_t;
|
||||
let ret = cvt(unsafe {
|
||||
|
||||
Reference in New Issue
Block a user