]> git.proxmox.com Git - proxmox-backup.git/commitdiff
Router: allow to set match parameter name
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 16 Nov 2018 07:29:23 +0000 (08:29 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 16 Nov 2018 07:29:23 +0000 (08:29 +0100)
src/api/router.rs
src/api3.rs

index 41b922e5c2c6163415b9c8dd85581337ce437f0f..2af43141792b9fea1af0597666c135529a3de09b 100644 (file)
@@ -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
     }
 
index 805e3414dfb9f9dd7f19ef45f7a2bf161edc731e..605cf27c80d102af424e3bb4124950b9be637122 100644 (file)
@@ -58,7 +58,7 @@ pub fn router() -> Router {
         });
 
     let route = Router::new()
-        .match_all(route2);
+        .match_all("node", route2);
 
     route
 }