@@ -22,9 +22,9 @@ struct RouteHandler {
22
22
/// The component ID that the route maps to.
23
23
component_id : String ,
24
24
/// The route, including any application base.
25
- based_route : String ,
25
+ based_route : Cow < ' static , str > ,
26
26
/// The route, not including any application base.
27
- raw_route : String ,
27
+ raw_route : Cow < ' static , str > ,
28
28
/// The route, including any application base and capturing information about whether it has a trailing wildcard.
29
29
/// (This avoids re-parsing the route string.)
30
30
parsed_based_route : ParsedRoute ,
@@ -111,8 +111,8 @@ impl Router {
111
111
112
112
let handler = RouteHandler {
113
113
component_id : re. component_id . to_string ( ) ,
114
- based_route : re. based_route ,
115
- raw_route : re. raw_route . to_string ( ) ,
114
+ based_route : re. based_route . into ( ) ,
115
+ raw_route : re. raw_route . to_string ( ) . into ( ) ,
116
116
parsed_based_route : parsed,
117
117
} ;
118
118
@@ -235,8 +235,8 @@ impl<'router, 'path> RouteMatch<'router, 'path> {
235
235
Self {
236
236
route_handler : Cow :: Owned ( RouteHandler {
237
237
component_id,
238
- based_route : "/..." . to_string ( ) ,
239
- raw_route : "/..." . to_string ( ) ,
238
+ based_route : "/..." . into ( ) ,
239
+ raw_route : "/..." . into ( ) ,
240
240
parsed_based_route : ParsedRoute :: TrailingWildcard ( String :: new ( ) ) ,
241
241
} ) ,
242
242
best_match : None ,
0 commit comments