From a337f132a57dfcc262b70537cf31686519e0f73c Mon Sep 17 00:00:00 2001 From: cssivision Date: Fri, 28 Jan 2022 00:44:25 +0800 Subject: [PATCH] fix(build): clippy warning for must_use (#892) --- tonic-build/src/client.rs | 2 ++ tonic-build/src/server.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tonic-build/src/client.rs b/tonic-build/src/client.rs index 5f04d44b4..cfe62d9ef 100644 --- a/tonic-build/src/client.rs +++ b/tonic-build/src/client.rs @@ -82,12 +82,14 @@ pub fn generate( /// /// This requires the server to support it otherwise it might respond with an /// error. + #[must_use] pub fn send_gzip(mut self) -> Self { self.inner = self.inner.send_gzip(); self } /// Enable decompressing responses with `gzip`. + #[must_use] pub fn accept_gzip(mut self) -> Self { self.inner = self.inner.accept_gzip(); self diff --git a/tonic-build/src/server.rs b/tonic-build/src/server.rs index 003ae1534..4d405b374 100644 --- a/tonic-build/src/server.rs +++ b/tonic-build/src/server.rs @@ -50,12 +50,14 @@ pub fn generate( let configure_compression_methods = if compression_enabled { quote! { /// Enable decompressing requests with `gzip`. + #[must_use] pub fn accept_gzip(mut self) -> Self { self.accept_compression_encodings.enable_gzip(); self } /// Compress responses with `gzip`, if the client supports it. + #[must_use] pub fn send_gzip(mut self) -> Self { self.send_compression_encodings.enable_gzip(); self