Skip to content

Commit 01feca8

Browse files
committed
allow chunked decoder to read poll after eof
1 parent cfd9398 commit 01feca8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/chunked/decoder.rs

+4
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ impl<R: Read + Unpin> Read for ChunkedDecoder<R> {
207207
) -> Poll<io::Result<usize>> {
208208
let this = &mut *self;
209209

210+
if let State::Done = this.state {
211+
return Poll::Ready(Ok(0));
212+
}
213+
210214
let mut n = std::mem::replace(&mut this.current, 0..0);
211215
let buffer = std::mem::replace(&mut this.buffer, POOL.alloc(INITIAL_CAPACITY));
212216
let mut needs_read = !matches!(this.state, State::Chunk(_, _));

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
//! }
8989
//! ```
9090
91-
#![forbid(unsafe_code, rust_2018_idioms)]
92-
#![deny(missing_debug_implementations, nonstandard_style)]
91+
#![forbid(unsafe_code)]
92+
#![deny(missing_debug_implementations, nonstandard_style, rust_2018_idioms)]
9393
#![warn(missing_docs, missing_doc_code_examples, unreachable_pub)]
9494
#![cfg_attr(test, deny(warnings))]
9595
#![allow(clippy::if_same_then_else)]

0 commit comments

Comments
 (0)