remove unnecessary negation
This commit is contained in:
parent
1839b64807
commit
75752eb13e
1 changed files with 3 additions and 3 deletions
6
src/cache/fs.rs
vendored
6
src/cache/fs.rs
vendored
|
@ -397,7 +397,9 @@ impl AsyncWrite for EncryptedDiskWriter {
|
||||||
mut self: Pin<&mut Self>,
|
mut self: Pin<&mut Self>,
|
||||||
cx: &mut Context<'_>,
|
cx: &mut Context<'_>,
|
||||||
) -> Poll<Result<(), std::io::Error>> {
|
) -> 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 new_self = Pin::into_inner(self);
|
||||||
let buffer = new_self.write_buffer.as_ref();
|
let buffer = new_self.write_buffer.as_ref();
|
||||||
match new_self.file.as_mut().poll_write(cx, buffer) {
|
match new_self.file.as_mut().poll_write(cx, buffer) {
|
||||||
|
@ -412,8 +414,6 @@ impl AsyncWrite for EncryptedDiskWriter {
|
||||||
}
|
}
|
||||||
Poll::Pending => Poll::Pending,
|
Poll::Pending => Poll::Pending,
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
self.file.as_mut().poll_flush(cx)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue