Skip to content

Commit

Permalink
fix: replaced match with if let (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
Markaeus authored Oct 17, 2022
1 parent 0b8d685 commit 896e4ef
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 896e4ef

Please sign in to comment.