Skip to content

Commit

Permalink
fix(build): clippy warning for must_use (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
cssivision authored Jan 27, 2022
1 parent 2b0ffee commit a337f13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tonic-build/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ pub fn generate<T: Service>(
///
/// 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
Expand Down
2 changes: 2 additions & 0 deletions tonic-build/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ pub fn generate<T: Service>(
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
Expand Down

0 comments on commit a337f13

Please sign in to comment.