Use advance() instead of split_to()
This commit is contained in:
parent
2620530cc2
commit
6b8ae19ba5
3 changed files with 4 additions and 2 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -3169,6 +3169,7 @@ dependencies = [
|
|||
"askama_axum",
|
||||
"axum",
|
||||
"axum-extra",
|
||||
"bytes",
|
||||
"clap",
|
||||
"directories",
|
||||
"flate2",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ askama = { version = "0.12.0", features = ["with-axum"] }
|
|||
askama_axum = "0.3.0"
|
||||
axum = { version = "0.6.19", features = ["macros", "headers"] }
|
||||
axum-extra = { version = "0.7.7", features = ["typed-routing"] }
|
||||
bytes = "1.4.0"
|
||||
clap = { version = "4.3.19", features = ["derive", "deprecated"] }
|
||||
directories = "5.0.1"
|
||||
flate2 = "1.0.26"
|
||||
|
|
|
|||
|
|
@ -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