INNER CODE UNIT · Rust
get_route_kind
vercel-community/rust · crates/vercel_runtime_router/src/lib.rs:126
let get_route_kind = |r: &str| -> RouteKind {
if DYNAMIC_ROUTE_REGEX.is_match(r) {
match DYNAMIC_OPTIONAL_CATCH_ALL_REGEX.is_match(r) {
true => return RouteKind::OptionalCatchAll,
// false => return RouteKind::Dynamic,
false => match DYNAMIC_CATCH_ALL_REGEX.is_match(r) {
true => return RouteKind::CatchAll,
false => return RouteKind::Dynamic,
},
}
}
if DYNAMIC_OPTIONAL_CATCH_ALL_REGEX.is_match(r) {
return RouteKind::OptionalCatchAll;
}
if DYNAMIC_CATCH_ALL_REGEX.is_match(r) {
return RouteKind::CatchAll;