From 75752eb13e2372b87a476feaf88552a187f09286 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sun, 6 Jun 2021 18:03:47 -0400 Subject: [PATCH] remove unnecessary negation --- src/cache/fs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cache/fs.rs b/src/cache/fs.rs index 220fbfc..7e125f4 100644 --- a/src/cache/fs.rs +++ b/src/cache/fs.rs @@ -397,7 +397,9 @@ impl AsyncWrite for EncryptedDiskWriter { mut self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll> { - 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) } }