From 32f0ae83d7be37dfd55c18c05072ed93231f3819 Mon Sep 17 00:00:00 2001 From: cssivision Date: Sun, 16 Jan 2022 12:00:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(tonic-build):=20fix=20clippy=20warns=20when?= =?UTF-8?q?=20a=20method=20returning=20Self=20doesn=E2=80=99t=20have=20the?= =?UTF-8?q?=20#[must=5Fuse]=20attribute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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