Use advance() instead of split_to()
This commit is contained in:
parent
2620530cc2
commit
6b8ae19ba5
3 changed files with 4 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::{io, path::PathBuf};
|
||||
|
||||
use axum::body::Bytes;
|
||||
use bytes::{Buf, Bytes};
|
||||
use flate2::read::GzDecoder;
|
||||
use futures::{Stream, StreamExt};
|
||||
use reqwest::Response;
|
||||
|
|
@ -35,7 +35,7 @@ impl io::Read for ReceiverReader {
|
|||
|
||||
let mut slice = &*self.rest;
|
||||
let result = slice.read(buf);
|
||||
let _ = self.rest.split_to(self.rest.len() - slice.len());
|
||||
self.rest.advance(self.rest.len() - slice.len());
|
||||
|
||||
result
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue