1
Fork 0

Auto merge of #23682 - tamird:DRY-is-empty, r=alexcrichton

r? @alexcrichton
This commit is contained in:
bors 2015-04-16 03:22:21 +00:00
commit 288809c8f3
104 changed files with 262 additions and 259 deletions

View file

@ -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")),