Skip to content

Commit 2f4f8a7

Browse files
authored
Fix tokio::bufread
Signed-off-by: Jiahao XU <[email protected]>
1 parent ce075ec commit 2f4f8a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tokio/bufread/generic/decoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ impl<R: AsyncBufRead, D: Decode> Decoder<R, D> {
8686
let mut input = PartialBuffer::new(input);
8787
let done = match this.decoder.decode(&mut input, output) {
8888
Ok(done) => {
89-
this.reader.as_mut().consume(input.written().len());
89+
let consumed = input.written().len();
90+
this.reader.as_mut().consume(consumed);
9091
done
9192
}
9293
// ignore the first error, occurs when input is empty

0 commit comments

Comments
 (0)