File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,17 @@ pin_project_lite::pin_project! {
27
27
pub ( crate ) state: State ,
28
28
#[ pin]
29
29
pub ( crate ) req: http:: Request ,
30
- pub ( crate ) route_params: Vec <Captures >,
30
+ pub ( crate ) route_params: Vec <Captures < ' static , ' static > >,
31
31
}
32
32
}
33
33
34
34
impl < State > Request < State > {
35
35
/// Create a new `Request`.
36
- pub ( crate ) fn new ( state : State , req : http_types:: Request , route_params : Vec < Captures > ) -> Self {
36
+ pub ( crate ) fn new (
37
+ state : State ,
38
+ req : http_types:: Request ,
39
+ route_params : Vec < Captures < ' static , ' static > > ,
40
+ ) -> Self {
37
41
Self {
38
42
state,
39
43
req,
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ impl<State> std::fmt::Debug for Router<State> {
26
26
/// The result of routing a URL
27
27
pub ( crate ) struct Selection < ' a , State > {
28
28
pub ( crate ) endpoint : & ' a DynEndpoint < State > ,
29
- pub ( crate ) params : Captures ,
29
+ pub ( crate ) params : Captures < ' static , ' static > ,
30
30
}
31
31
32
32
impl < State : Clone + Send + Sync + ' static > Router < State > {
@@ -62,12 +62,12 @@ impl<State: Clone + Send + Sync + 'static> Router<State> {
62
62
{
63
63
Selection {
64
64
endpoint : m. handler ( ) ,
65
- params : m. captures ( ) ,
65
+ params : m. captures ( ) . into_owned ( ) ,
66
66
}
67
67
} else if let Some ( m) = self . all_method_router . best_match ( path) {
68
68
Selection {
69
69
endpoint : m. handler ( ) ,
70
- params : m. captures ( ) ,
70
+ params : m. captures ( ) . into_owned ( ) ,
71
71
}
72
72
} else if method == http_types:: Method :: Head {
73
73
// If it is a HTTP HEAD request then check if there is a callback in the endpoints map
You can’t perform that action at this time.
0 commit comments