We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
do_poll_read
1 parent 6c0835e commit 386f59eCopy full SHA for 386f59e
crates/async-compression/src/generic/bufread/encoder.rs
@@ -35,9 +35,12 @@ impl Encoder {
35
State::Encoding(mut read) => match input.as_mut() {
36
None => {
37
if read == 0 {
38
- // Poll for more data
39
- // TODO (nobodyxu): Return Ok if `!output.written().is_empty()`
40
- break;
+ if output.written().is_empty() {
+ // Poll for more data
+ break;
41
+ } else {
42
+ return ControlFlow::Break(Ok(()));
43
+ }
44
} else {
45
State::Flushing
46
}
0 commit comments