Use advance() instead of split_to()

This commit is contained in:
Joscha 2023-08-14 14:01:34 +02:00
parent 2620530cc2
commit 6b8ae19ba5
3 changed files with 4 additions and 2 deletions

View file

@ -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
}