remove unnecessary negation

feature/v32-tokens
Edward Shen 2021-06-06 18:03:47 -04:00
parent 1839b64807
commit 75752eb13e
Signed by: edward
GPG Key ID: 19182661E818369F
1 changed files with 3 additions and 3 deletions

6
src/cache/fs.rs vendored
View File

@ -397,7 +397,9 @@ impl AsyncWrite for EncryptedDiskWriter {
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), std::io::Error>> {
if !self.as_ref().write_buffer.is_empty() {
if self.as_ref().write_buffer.is_empty() {
self.file.as_mut().poll_flush(cx)
} else {
let new_self = Pin::into_inner(self);
let buffer = new_self.write_buffer.as_ref();
match new_self.file.as_mut().poll_write(cx, buffer) {
@ -412,8 +414,6 @@ impl AsyncWrite for EncryptedDiskWriter {
}
Poll::Pending => Poll::Pending,
}
} else {
self.file.as_mut().poll_flush(cx)
}
}