Rename Decompressor to BrotliDecoder to align with gzip

This commit is contained in:
Malloc Voidstar
2021-10-02 12:25:03 -07:00
committed by Martin Algesten
parent 873e6066f3
commit 23e993689a

View File

@@ -22,7 +22,7 @@ use encoding_rs::Encoding;
use flate2::read::GzDecoder; use flate2::read::GzDecoder;
#[cfg(feature = "brotli")] #[cfg(feature = "brotli")]
use brotli_decompressor::Decompressor; use brotli_decompressor::Decompressor as BrotliDecoder;
pub const DEFAULT_CONTENT_TYPE: &str = "text/plain"; pub const DEFAULT_CONTENT_TYPE: &str = "text/plain";
pub const DEFAULT_CHARACTER_SET: &str = "utf-8"; pub const DEFAULT_CHARACTER_SET: &str = "utf-8";
@@ -549,7 +549,7 @@ impl Compression {
fn wrap_reader(self, reader: Box<dyn Read + Send>) -> Box<dyn Read + Send> { fn wrap_reader(self, reader: Box<dyn Read + Send>) -> Box<dyn Read + Send> {
match self { match self {
#[cfg(feature = "brotli")] #[cfg(feature = "brotli")]
Compression::Brotli => Box::new(Decompressor::new(reader, 4096)), Compression::Brotli => Box::new(BrotliDecoder::new(reader, 4096)),
#[cfg(feature = "gzip")] #[cfg(feature = "gzip")]
Compression::Gzip => Box::new(GzDecoder::new(reader)), Compression::Gzip => Box::new(GzDecoder::new(reader)),
} }