order catch all routes after non-catch all routes

This commit is contained in:
Evan Almloff committed 2023-05-21 11:58:35 -05:00
1 parent 3d8bceb77f
commit be3dae4b05
1 file changed
+7 -1
+7 -1
View File
@@ -40,7 +40,13 @@ impl<'a> RouteTree<'a> {
match seg {
RouteTreeSegmentData::Static { .. } => 0,
RouteTreeSegmentData::Layout { .. } => 1,
RouteTreeSegmentData::Route(_) => 1,
RouteTreeSegmentData::Route(route) => {
// Routes that end in a catch all segment should be checked last
match route.segments.last() {
Some(RouteSegment::CatchAll(..)) => 2,
_ => 1,
}
}
}
});
}