Skip to content

Commit

Permalink
Remove match infallible {} workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
mendess committed Oct 18, 2024
1 parent 2b5e141 commit 4e39cc0
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions crates/daphne-worker/src/storage_proxy/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ pub async fn bearer_auth(
return (StatusCode::UNAUTHORIZED, "Incorrect authorization token").into_response();
}

match next.call(request.map(axum::body::Body::new)).await {
Ok(r) => r,
Err(infalible) => match infalible {},
}
let Ok(response) = next.call(request.map(axum::body::Body::new)).await;
response
}

#[worker::send]
Expand All @@ -62,10 +60,7 @@ pub async fn time_kv_requests(
mut next: Next,
) -> axum::response::Response {
let start = worker::Date::now();
let response = match next.call(request).await {
Ok(response) => response,
Err(infallible) => match infallible {},
};
let Ok(response) = next.call(request).await;
let elapsed = elapsed(&start);

let op = match method {
Expand Down Expand Up @@ -97,10 +92,7 @@ pub async fn time_do_requests(
mut next: Next,
) -> axum::response::Response {
let start = worker::Date::now();
let response = match next.call(request).await {
Ok(response) => response,
Err(infallible) => match infallible {},
};
let Ok(response) = next.call(request).await;
let elapsed = elapsed(&start);
ctx.metrics.durable_request_time_seconds_observe(
&uri,
Expand Down

0 comments on commit 4e39cc0

Please sign in to comment.