Skip to content

Commit a337f13

Browse files
authored
fix(build): clippy warning for must_use (#892)
1 parent 2b0ffee commit a337f13

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tonic-build/src/client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ pub fn generate<T: Service>(
8282
///
8383
/// This requires the server to support it otherwise it might respond with an
8484
/// error.
85+
#[must_use]
8586
pub fn send_gzip(mut self) -> Self {
8687
self.inner = self.inner.send_gzip();
8788
self
8889
}
8990

9091
/// Enable decompressing responses with `gzip`.
92+
#[must_use]
9193
pub fn accept_gzip(mut self) -> Self {
9294
self.inner = self.inner.accept_gzip();
9395
self

tonic-build/src/server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ pub fn generate<T: Service>(
5050
let configure_compression_methods = if compression_enabled {
5151
quote! {
5252
/// Enable decompressing requests with `gzip`.
53+
#[must_use]
5354
pub fn accept_gzip(mut self) -> Self {
5455
self.accept_compression_encodings.enable_gzip();
5556
self
5657
}
5758

5859
/// Compress responses with `gzip`, if the client supports it.
60+
#[must_use]
5961
pub fn send_gzip(mut self) -> Self {
6062
self.send_compression_encodings.enable_gzip();
6163
self

0 commit comments

Comments
 (0)