Implement read_exact for the Read trait

This implements the proposed "read_exact" RFC
(https://github.com/rust-lang/rfcs/pull/980).
This commit is contained in:
Cesar Eduardo Barros
2015-07-20 00:23:37 -03:00
parent ef04b07239
commit ff81920f03
4 changed files with 140 additions and 0 deletions

View File

@@ -271,6 +271,9 @@ impl Read for Stdin {
fn read_to_string(&mut self, buf: &mut String) -> io::Result<usize> {
self.lock().read_to_string(buf)
}
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
self.lock().read_exact(buf)
}
}
#[stable(feature = "rust1", since = "1.0.0")]