diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-12-30 10:51:18 -0800 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-12-30 17:06:08 -0800 |
| commit | 6abfac083feafc73e5d736177755cce3bfb7153f (patch) | |
| tree | d5502fab0dd68ea96057616eb20d90a2c9050218 /src/libstd/io | |
| parent | 6e1879eaf1cb5e727eb134a3e27018f7535852eb (diff) | |
| download | rust-6abfac083feafc73e5d736177755cce3bfb7153f.tar.gz rust-6abfac083feafc73e5d736177755cce3bfb7153f.zip | |
Fallout from stabilization
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/buffered.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index fdbce101c1d..0fba0f6704b 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -439,9 +439,10 @@ mod test { impl Reader for ShortReader { fn read(&mut self, _: &mut [u8]) -> io::IoResult<uint> { - match self.lengths.remove(0) { - Some(i) => Ok(i), - None => Err(io::standard_error(io::EndOfFile)) + if self.lengths.is_empty() { + Err(io::standard_error(io::EndOfFile)) + } else { + Ok(self.lengths.remove(0)) } } } |
