Router: allow to set match parameter name
This commit is contained in:
parent
2ab1f7119c
commit
484eb9ac19
|
@ -42,8 +42,8 @@ impl Router {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn match_all(mut self, router: Router) -> Self {
|
||||
self.subroute = SubRoute::MatchAll { router: Box::new(router), param_name: "test".into() };
|
||||
pub fn match_all<S>(mut self, param_name: S, router: Router) -> Self where S: Into<String> {
|
||||
self.subroute = SubRoute::MatchAll { router: Box::new(router), param_name: param_name.into() };
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ pub fn router() -> Router {
|
|||
});
|
||||
|
||||
let route = Router::new()
|
||||
.match_all(route2);
|
||||
.match_all("node", route2);
|
||||
|
||||
route
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue