diff options
| author | Cesar Eduardo Barros <cesarb@cesarb.eti.br> | 2015-07-20 00:23:37 -0300 |
|---|---|---|
| committer | Cesar Eduardo Barros <cesarb@cesarb.eti.br> | 2015-08-24 19:10:08 -0300 |
| commit | ff81920f03866674080ac63b565cc9d30f80c450 (patch) | |
| tree | 9619a464863630730373297a9a35e7bccba94fcf /src/libstd/io/stdio.rs | |
| parent | ef04b07239d75f2b6bb66f18855f3af695d76e1c (diff) | |
| download | rust-ff81920f03866674080ac63b565cc9d30f80c450.tar.gz rust-ff81920f03866674080ac63b565cc9d30f80c450.zip | |
Implement read_exact for the Read trait
This implements the proposed "read_exact" RFC (https://github.com/rust-lang/rfcs/pull/980).
Diffstat (limited to 'src/libstd/io/stdio.rs')
| -rw-r--r-- | src/libstd/io/stdio.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index d8b7c8a282c..88f40d764e2 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -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")] |
