Skip to content

Commit d43bb91

Browse files
committed
sentry - lib - handle_routing - switch to match
1 parent 565add7 commit d43bb91

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sentry/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ async fn handle_routing(
8686
req: Request<Body>,
8787
(adapter, config): (impl Adapter, Config),
8888
) -> Response<Body> {
89-
if req.uri().path().starts_with("/cfg") && req.method() == Method::GET {
90-
crate::routes::cfg::return_config(&config)
91-
} else if req.uri().path().starts_with("/channel") {
92-
crate::routes::channel::handle_channel_routes(req, adapter).await
93-
} else {
94-
Err(ResponseError::NotFound)
89+
match (req.uri().path(), req.method()) {
90+
("/cfg", &Method::GET) => crate::routes::cfg::return_config(&config),
91+
(route, _) if route.starts_with("/channel") => {
92+
crate::routes::channel::handle_channel_routes(req, adapter).await
93+
}
94+
_ => Err(ResponseError::NotFound),
9595
}
9696
.unwrap_or_else(|response_err| match response_err {
9797
ResponseError::NotFound => not_found(),

0 commit comments

Comments
 (0)