mirror of https://github.com/fafhrd91/actix-web
awc: relace cfg attributes for HTTPS_ENCODING with cfg-if
This commit is contained in:
parent
cef47d1dfb
commit
62e390e814
|
@ -21,19 +21,15 @@ use crate::frozen::FrozenClientRequest;
|
||||||
use crate::sender::{PrepForSendingError, RequestSender, SendClientRequest};
|
use crate::sender::{PrepForSendingError, RequestSender, SendClientRequest};
|
||||||
use crate::ClientConfig;
|
use crate::ClientConfig;
|
||||||
|
|
||||||
#[cfg(any(feature = "flate2-zlib", feature = "flate2-rust"))]
|
cfg_if::cfg_if! {
|
||||||
|
if #[cfg(any(feature = "flate2-zlib", feature = "flate2-rust"))] {
|
||||||
const HTTPS_ENCODING: &str = "br, gzip, deflate";
|
const HTTPS_ENCODING: &str = "br, gzip, deflate";
|
||||||
#[cfg(all(
|
} else if #[cfg(feature = "compress")] {
|
||||||
not(any(feature = "flate2-zlib", feature = "flate2-rust")),
|
|
||||||
feature = "compress"
|
|
||||||
))]
|
|
||||||
const HTTPS_ENCODING: &str = "br";
|
const HTTPS_ENCODING: &str = "br";
|
||||||
#[cfg(not(any(
|
} else {
|
||||||
feature = "flate2-zlib",
|
|
||||||
feature = "flate2-rust",
|
|
||||||
feature = "compress"
|
|
||||||
)))]
|
|
||||||
const HTTPS_ENCODING: &str = "identity";
|
const HTTPS_ENCODING: &str = "identity";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// An HTTP Client request builder
|
/// An HTTP Client request builder
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in New Issue