Skip to content

Commit 6bb0a58

Browse files
committed
Simplify "irrefutable if let pattern"
1 parent 5b36494 commit 6bb0a58

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/middleware/static_or_continue.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ async fn serve<P: AsRef<Path>>(path: P, request: Request, next: Next) -> Respons
2525
*static_req.headers_mut() = request.headers().clone();
2626

2727
let serve_dir = ServeDir::new(path).precompressed_br().precompressed_gzip();
28-
if let Ok(response) = serve_dir.oneshot(static_req).await {
29-
if response.status() != StatusCode::NOT_FOUND {
30-
return response.map(axum::body::Body::new);
31-
}
28+
let Ok(response) = serve_dir.oneshot(static_req).await;
29+
if response.status() != StatusCode::NOT_FOUND {
30+
return response.map(axum::body::Body::new);
3231
}
3332
}
3433

0 commit comments

Comments
 (0)