Return WouldBlock if flushing did not complete. (#265)

This commit is contained in:
Toralf Wittner
2018-06-21 11:57:15 +02:00
committed by GitHub
parent 217fae405f
commit 8aa719c532

View File

@ -145,8 +145,10 @@ where
#[inline]
fn flush(&mut self) -> Result<(), IoError> {
self.inner.poll_complete()?;
Ok(())
match self.inner.poll_complete()? {
Async::Ready(()) => Ok(()),
Async::NotReady => Err(IoError::new(IoErrorKind::WouldBlock, "not ready"))
}
}
}