]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/server/rest.rs: use generics to pass RpcEnvironment
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 8 May 2019 09:09:01 +0000 (11:09 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 8 May 2019 09:09:01 +0000 (11:09 +0200)
src/server/rest.rs

index 789276dbb3f14e8b58f5950d44cf701298c88ac5..9a9d48b15b0bf93c8ec11a8cd8b7349d9de0b76e 100644 (file)
@@ -223,8 +223,8 @@ fn proxy_protected_request(
     return Box::new(resp);
 }
 
-pub fn handle_sync_api_request(
-    mut rpcenv: RestEnvironment,
+pub fn handle_sync_api_request<Env: RpcEnvironment>(
+    mut rpcenv: Env,
     info: &'static ApiMethod,
     formatter: &'static OutputFormatter,
     parts: Parts,
@@ -263,8 +263,8 @@ pub fn handle_sync_api_request(
     Box::new(resp)
 }
 
-pub fn handle_async_api_request(
-    mut rpcenv: RestEnvironment,
+pub fn handle_async_api_request<Env: RpcEnvironment>(
+    mut rpcenv: Env,
     info: &'static ApiAsyncMethod,
     formatter: &'static OutputFormatter,
     parts: Parts,