Skip to content

Commit

Permalink
Simplify impl SupportedEncodings for AcceptEncoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Jan 27, 2024
1 parent 57b8b6f commit 49ead0f
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions tower-http/src/compression_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,49 +71,37 @@ impl SupportedEncodings for AcceptEncoding {
#[allow(dead_code)]
fn gzip(&self) -> bool {
#[cfg(any(feature = "decompression-gzip", feature = "compression-gzip"))]
{
self.gzip
}
return self.gzip;

#[cfg(not(any(feature = "decompression-gzip", feature = "compression-gzip")))]
{
false
}
return false;
}

#[allow(dead_code)]
fn deflate(&self) -> bool {
#[cfg(any(feature = "decompression-deflate", feature = "compression-deflate"))]
{
self.deflate
}
return self.deflate;

#[cfg(not(any(feature = "decompression-deflate", feature = "compression-deflate")))]
{
false
}
return false;
}

#[allow(dead_code)]
fn br(&self) -> bool {
#[cfg(any(feature = "decompression-br", feature = "compression-br"))]
{
self.br
}
return self.br;

#[cfg(not(any(feature = "decompression-br", feature = "compression-br")))]
{
false
}
return false;
}

#[allow(dead_code)]
fn zstd(&self) -> bool {
#[cfg(any(feature = "decompression-zstd", feature = "compression-zstd"))]
{
self.zstd
}
return self.zstd;

#[cfg(not(any(feature = "decompression-zstd", feature = "compression-zstd")))]
{
false
}
return false;
}
}

Expand Down

0 comments on commit 49ead0f

Please sign in to comment.