order catch all routes after non-catch all routes
This commit is contained in:
1 parent
3d8bceb77f
commit
be3dae4b05
1 file changed
+7
-1
@@ -40,7 +40,13 @@ impl<'a> RouteTree<'a> {
|
|||||||
match seg {
|
match seg {
|
||||||
RouteTreeSegmentData::Static { .. } => 0,
|
RouteTreeSegmentData::Static { .. } => 0,
|
||||||
RouteTreeSegmentData::Layout { .. } => 1,
|
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,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user