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));