Skip to content

Commit

Permalink
Cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
astoring committed Nov 29, 2023
1 parent 845728f commit 4b33811
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions crates/core/src/conn/quinn/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,9 @@ async fn process_web_transport(
if let Err(e) = stream.send_data(frame.into_data().unwrap_or_default()).await {
tracing::error!(error = ?e, "unable to send data to connection peer");
}
} else {
if let Err(e) = stream.send_trailers(frame.into_trailers().unwrap_or_default()).await {
} else if let Err(e) = stream.send_trailers(frame.into_trailers().unwrap_or_default()).await {
tracing::error!(error = ?e, "unable to send trailers to connection peer");
}
}
}
Err(e) => {
tracing::error!(error = ?e, "unable to poll data from connection");
Expand Down Expand Up @@ -231,11 +229,9 @@ where
if let Err(e) = tx.send_data(frame.into_data().unwrap_or_default()).await {
tracing::error!(error = ?e, "unable to send data to connection peer");
}
} else {
if let Err(e) = tx.send_trailers(frame.into_trailers().unwrap_or_default()).await {
} else if let Err(e) = tx.send_trailers(frame.into_trailers().unwrap_or_default()).await {
tracing::error!(error = ?e, "unable to send trailers to connection peer");
}
}
}
Err(e) => {
tracing::error!(error = ?e, "unable to poll data from connection");
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/tower_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ where
{
async fn handle(&self, req: &mut Request, _depot: &mut Depot, res: &mut Response, _ctrl: &mut FlowCtrl) {
let mut svc = self.0.clone();
if let Err(_) = svc.ready().await {
if svc.ready().await.is_err() {
tracing::error!("tower service not ready.");
res.render(StatusError::internal_server_error().cause("tower service not ready."));
return;
Expand Down Expand Up @@ -192,7 +192,7 @@ where
{
async fn handle(&self, req: &mut Request, depot: &mut Depot, res: &mut Response, ctrl: &mut FlowCtrl) {
let mut svc = self.0.clone();
if let Err(_) = svc.ready().await {
if svc.ready().await.is_err() {
tracing::error!("tower service not ready.");
res.render(StatusError::internal_server_error().cause("tower service not ready."));
return;
Expand Down

0 comments on commit 4b33811

Please sign in to comment.