From 3bbbece6a2e68765069e397d3b0553e76d1d0850 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 9 May 2019 18:01:24 +0200 Subject: [PATCH] handle_async_api_request: put rpcenv into a Box So that we can pass rpcenv into futures. --- src/server/rest.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/rest.rs b/src/server/rest.rs index 84611628..8ecfc02b 100644 --- a/src/server/rest.rs +++ b/src/server/rest.rs @@ -264,7 +264,7 @@ pub fn handle_sync_api_request( } pub fn handle_async_api_request( - mut rpcenv: Env, + rpcenv: Env, info: &'static ApiAsyncMethod, formatter: &'static OutputFormatter, parts: Parts, @@ -294,7 +294,7 @@ pub fn handle_async_api_request( } }; - match (info.handler)(parts, req_body, params, info, &mut rpcenv) { + match (info.handler)(parts, req_body, params, info, Box::new(rpcenv)) { Ok(future) => future, Err(err) => { let resp = (formatter.format_error)(Error::from(err));