awc: relace cfg attributes for HTTPS_ENCODING with cfg-if

This commit is contained in:
j-brn 2020-10-16 22:05:42 +02:00
parent cef47d1dfb
commit 62e390e814
1 changed files with 9 additions and 13 deletions

View File

@ -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! {
const HTTPS_ENCODING: &str = "br, gzip, deflate"; if #[cfg(any(feature = "flate2-zlib", feature = "flate2-rust"))] {
#[cfg(all( const HTTPS_ENCODING: &str = "br, gzip, deflate";
not(any(feature = "flate2-zlib", feature = "flate2-rust")), } else if #[cfg(feature = "compress")] {
feature = "compress" const HTTPS_ENCODING: &str = "br";
))] } else {
const HTTPS_ENCODING: &str = "br"; const HTTPS_ENCODING: &str = "identity";
#[cfg(not(any( }
feature = "flate2-zlib", }
feature = "flate2-rust",
feature = "compress"
)))]
const HTTPS_ENCODING: &str = "identity";
/// An HTTP Client request builder /// An HTTP Client request builder
/// ///