Skip to content

Commit 5f69b60

Browse files
committed
Some more cows
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
1 parent c9b649b commit 5f69b60

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/http/src/routes.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ struct RouteHandler {
2222
/// The component ID that the route maps to.
2323
component_id: String,
2424
/// The route, including any application base.
25-
based_route: String,
25+
based_route: Cow<'static, str>,
2626
/// The route, not including any application base.
27-
raw_route: String,
27+
raw_route: Cow<'static, str>,
2828
/// The route, including any application base and capturing information about whether it has a trailing wildcard.
2929
/// (This avoids re-parsing the route string.)
3030
parsed_based_route: ParsedRoute,
@@ -111,8 +111,8 @@ impl Router {
111111

112112
let handler = RouteHandler {
113113
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(),
116116
parsed_based_route: parsed,
117117
};
118118

@@ -235,8 +235,8 @@ impl<'router, 'path> RouteMatch<'router, 'path> {
235235
Self {
236236
route_handler: Cow::Owned(RouteHandler {
237237
component_id,
238-
based_route: "/...".to_string(),
239-
raw_route: "/...".to_string(),
238+
based_route: "/...".into(),
239+
raw_route: "/...".into(),
240240
parsed_based_route: ParsedRoute::TrailingWildcard(String::new()),
241241
}),
242242
best_match: None,

0 commit comments

Comments
 (0)