Skip to content

Commit

Permalink
chore: fix some clippy warnings
Browse files Browse the repository at this point in the history
This commit fixes clippy warning `useless_conversion`.

Also, a false positive rule `literal_string_with_formatting_args` is
introduced in the nightly toolchain, we cannot `allow` it because it
is a new rule that does not exist in the stable toolchain, so we
should ignore it manually.

Ref: rust-lang/rust-clippy#13928

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
  • Loading branch information
yukiiiteru committed Jan 20, 2025
1 parent 5777040 commit 28697f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion volo-grpc/src/layer/loadbalance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ where
.await
.map_err(|err| err.into())?,
_ => {
return self.service.call(cx, req).await.map_err(Into::into);
return self.service.call(cx, req).await;
}
};

Expand Down
4 changes: 2 additions & 2 deletions volo-thrift/src/client/layer/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ where
Some(duration) => {
let start = std::time::Instant::now();
match tokio::time::timeout(duration, self.inner.call(cx, req)).await {
Ok(r) => r.map_err(Into::into),
Ok(r) => r,
Err(_) => {
let msg = format!(
"[VOLO] thrift rpc call timeout, rpcinfo: {:?}, elpased: {:?}, \
Expand All @@ -43,7 +43,7 @@ where
}
}
}
None => self.inner.call(cx, req).await.map_err(Into::into),
None => self.inner.call(cx, req).await,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion volo-thrift/src/transport/pool/make_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ where

async fn call(&self, kv: (K, Ver)) -> Result<Self::Response, Self::Error> {
let mt = self.inner.clone();
self.pool.get(kv.0, kv.1, mt).await.map_err(Into::into)
self.pool.get(kv.0, kv.1, mt).await
}
}

0 comments on commit 28697f0

Please sign in to comment.