From 1af2eef655cefb7158231020afefab0fdb528a64 Mon Sep 17 00:00:00 2001 From: Moritz Gunz Date: Mon, 20 Sep 2021 19:44:46 +0200 Subject: [PATCH] fix: Make CompressionLayer::default() use ::new() --- tower-http/src/compression/layer.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tower-http/src/compression/layer.rs b/tower-http/src/compression/layer.rs index 291a24af..ac4c6066 100644 --- a/tower-http/src/compression/layer.rs +++ b/tower-http/src/compression/layer.rs @@ -8,12 +8,18 @@ use tower_layer::Layer; /// `Content-Encoding` header to responses. /// /// See the [module docs](crate::compression) for more details. -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug)] pub struct CompressionLayer { accept: AcceptEncoding, min_size: u16, } +impl Default for CompressionLayer { + fn default() -> Self { + Self::new() + } +} + impl Layer for CompressionLayer { type Service = Compression;