Skip to content

Commit

Permalink
chore(volo-thrift): clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ggiggle committed Jul 3, 2024
1 parent b0e1639 commit fad0cbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions volo-thrift/src/codec/default/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ impl<E: ZeroCopyEncoder, W: AsyncWrite + Unpin + Send + Sync + 'static> Encoder
let mut write_result: Result<(), ThriftException> = self
.encoder
.encode(cx, &mut self.linked_bytes, msg)
.map_err(|e| {
.inspect_err(|_| {
// record the error time
cx.stats_mut().record_encode_end_at();
e
});
if write_result.is_ok() {
cx.stats_mut().record_encode_end_at();
Expand Down
3 changes: 1 addition & 2 deletions volo-thrift/src/codec/default/thrift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ impl ZeroCopyDecoder for ThriftCodec {

// detect protocol
// TODO: support using protocol from TTHeader
let protocol = detect(buf).map_err(|e| {
let protocol = detect(buf).inspect_err(|_| {
cx.stats_mut().record_read_end_at();
e
})?;
// TODO: do we need to check the response protocol at client side?
let res = match protocol {
Expand Down

0 comments on commit fad0cbf

Please sign in to comment.