Skip to content

Commit

Permalink
fix: replaced match with if let (sparckles#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
Markaeus authored and Shending-Help committed Oct 19, 2022
1 parent 6b146c2 commit 4210001
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,8 @@ async fn index(
}
};

match middleware_router.get_route("AFTER_REQUEST", req.uri().path()) {
Some(((handler_function, number_of_params), route_params)) => {
let x = handle_http_middleware_request(
if let Some(((handler_function, number_of_params), route_params)) = middleware_router.get_route("AFTER_REQUEST", req.uri().path()) {
let x = handle_http_middleware_request(
handler_function,
number_of_params,
&headers_dup,
Expand All @@ -467,8 +466,6 @@ async fn index(
)
.await;
debug!("{:?}", x);
}
None => {}
};

response
Expand Down

0 comments on commit 4210001

Please sign in to comment.