Skip to content

Commit e82f61d

Browse files
committed
chore: Remove redundant temporary variable
1 parent 87f195b commit e82f61d

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tonic/src/server/grpc.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,40 +183,36 @@ where
183183

184184
#[doc(hidden)]
185185
pub fn apply_compression_config(
186-
self,
186+
mut self,
187187
accept_encodings: EnabledCompressionEncodings,
188188
send_encodings: EnabledCompressionEncodings,
189189
) -> Self {
190-
let mut this = self;
191-
192190
for &encoding in CompressionEncoding::ENCODINGS {
193191
if accept_encodings.is_enabled(encoding) {
194-
this = this.accept_compressed(encoding);
192+
self = self.accept_compressed(encoding);
195193
}
196194
if send_encodings.is_enabled(encoding) {
197-
this = this.send_compressed(encoding);
195+
self = self.send_compressed(encoding);
198196
}
199197
}
200198

201-
this
199+
self
202200
}
203201

204202
#[doc(hidden)]
205203
pub fn apply_max_message_size_config(
206-
self,
204+
mut self,
207205
max_decoding_message_size: Option<usize>,
208206
max_encoding_message_size: Option<usize>,
209207
) -> Self {
210-
let mut this = self;
211-
212208
if let Some(limit) = max_decoding_message_size {
213-
this = this.max_decoding_message_size(limit);
209+
self = self.max_decoding_message_size(limit);
214210
}
215211
if let Some(limit) = max_encoding_message_size {
216-
this = this.max_encoding_message_size(limit);
212+
self = self.max_encoding_message_size(limit);
217213
}
218214

219-
this
215+
self
220216
}
221217

222218
/// Handle a single unary gRPC request.

0 commit comments

Comments
 (0)