1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00
This commit is contained in:
Rob Ede
2021-06-24 15:11:01 +01:00
parent 2d8d2f5ab0
commit 93aa86e30b
2 changed files with 20 additions and 16 deletions

View File

@ -480,6 +480,7 @@ impl ClientRequest {
// supported, so we cannot guess Accept-Encoding HTTP header.
if slf.response_decompress {
// Set Accept-Encoding with compression algorithm awc is built with.
#[allow(clippy::vec_init_then_push)]
#[cfg(feature = "__compress")]
let accept_encoding = {
let mut encoding = vec![];
@ -496,7 +497,11 @@ impl ClientRequest {
#[cfg(feature = "compress-zstd")]
encoding.push("zstd");
assert!(!encoding.is_empty(), "encoding cannot be empty unless __compress feature has been explictily enabled.");
assert!(
!encoding.is_empty(),
"encoding can not be empty unless __compress feature has been explicitly enabled"
);
encoding.join(", ")
};