src/server/rest.rs: use generics to pass RpcEnvironment

This commit is contained in:
Dietmar Maurer 2019-05-08 11:09:01 +02:00
parent 2edc341b29
commit f757b30efc
1 changed files with 4 additions and 4 deletions

View 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,