diff options
| author | bors <bors@rust-lang.org> | 2015-04-16 03:22:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-04-16 03:22:21 +0000 |
| commit | 288809c8f35d9b37f2e4f5c3ac168f56dbc3bbc4 (patch) | |
| tree | 2606f4c9c39c215161feb41a74348d7e07d79c1c /src/libstd/io | |
| parent | e40449e0d545561c73a9b9b324b5971b533a87b7 (diff) | |
| parent | c55ae1dc3094912c935fb95cf915841af0259305 (diff) | |
| download | rust-288809c8f35d9b37f2e4f5c3ac168f56dbc3bbc4.tar.gz rust-288809c8f35d9b37f2e4f5c3ac168f56dbc3bbc4.zip | |
Auto merge of #23682 - tamird:DRY-is-empty, r=alexcrichton
r? @alexcrichton
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 93c6deac6e5..07b43b6c5db 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -349,7 +349,7 @@ pub trait Write { /// This function will return the first error that `write` returns. #[stable(feature = "rust1", since = "1.0.0")] fn write_all(&mut self, mut buf: &[u8]) -> Result<()> { - while buf.len() > 0 { + while !buf.is_empty() { match self.write(buf) { Ok(0) => return Err(Error::new(ErrorKind::WriteZero, "failed to write whole buffer")), |
