@@ -39,31 +39,20 @@ pub fn generate<T: Service>(
3939 // let mod_attributes = attributes.for_mod(package);
4040 // let struct_attributes = attributes.for_struct(&path);
4141
42- let compression_enabled = cfg ! ( feature = "compression" ) ;
43-
44- // let compression_config_ty = if compression_enabled {
45- // quote! { EnabledCompressionEncodings }
46- // } else {
47- // quote! { () }
48- // };
49-
50- let configure_compression_methods = if compression_enabled {
51- quote ! {
52- /// Enable decompressing requests with the given encoding.
53- #[ must_use]
54- pub fn accept_compressed( self , _encoding: CompressionEncoding ) -> Self {
55- // self.accept_compression_encodings.enable(encoding);
56- self
57- }
58- /// Compress responses with the given encoding, if the client supports it.
59- #[ must_use]
60- pub fn send_compressed( self , _encoding: CompressionEncoding ) -> Self {
61- // self.send_compression_encodings.enable(encoding);
62- self
63- }
42+ let configure_compression_methods = quote ! {
43+ /// Enable decompressing requests with the given encoding.
44+ #[ must_use]
45+ pub fn accept_compressed( self , _encoding: CompressionEncoding ) -> Self {
46+ // self.accept_compression_encodings.enable(encoding);
47+ self
48+ }
49+
50+ /// Compress responses with the given encoding, if the client supports it.
51+ #[ must_use]
52+ pub fn send_compressed( self , _encoding: CompressionEncoding ) -> Self {
53+ // self.send_compression_encodings.enable(encoding);
54+ self
6455 }
65- } else {
66- quote ! { }
6756 } ;
6857
6958 let configure_max_message_size_methods = quote ! {
@@ -92,8 +81,6 @@ pub fn generate<T: Service>(
9281 dead_code,
9382 missing_docs,
9483 unused_mut,
95- // will trigger if compression is disabled
96- clippy:: let_unit_value,
9784 ) ]
9885 use tonic:: codegen:: { http:: uri:: PathAndQuery , futures:: { stream:: { self , Stream , StreamExt } , future:: FutureExt } , * } ;
9986
0 commit comments