diff --git a/src/server/formatter.rs b/src/server/formatter.rs index 28380937..ca2a6e73 100644 --- a/src/server/formatter.rs +++ b/src/server/formatter.rs @@ -11,7 +11,7 @@ pub struct ErrorMessageExtension(pub String); pub struct OutputFormatter { - pub format_data: fn(data: Value, rpcenv: &RpcEnvironment) -> Response, + pub format_data: fn(data: Value, rpcenv: &dyn RpcEnvironment) -> Response, pub format_error: fn(err: Error) -> Response, } @@ -39,7 +39,7 @@ pub fn json_data_response(data: Value) -> Response { response } -fn json_format_data(data: Value, rpcenv: &RpcEnvironment) -> Response { +fn json_format_data(data: Value, rpcenv: &dyn RpcEnvironment) -> Response { let mut result = json!({ "data": data @@ -82,7 +82,7 @@ pub static JSON_FORMATTER: OutputFormatter = OutputFormatter { format_error: json_error_response, }; -fn extjs_format_data(data: Value, rpcenv: &RpcEnvironment) -> Response { +fn extjs_format_data(data: Value, rpcenv: &dyn RpcEnvironment) -> Response { let mut result = json!({ "data": data, diff --git a/src/server/rest.rs b/src/server/rest.rs index fe6172ba..445af4de 100644 --- a/src/server/rest.rs +++ b/src/server/rest.rs @@ -47,7 +47,7 @@ impl NewService for RestServer type Error = hyper::Error; type InitError = hyper::Error; type Service = ApiService; - type Future = Box + Send>; + type Future = Box + Send>; fn new_service(&self) -> Self::Future { Box::new(future::ok(ApiService { api_config: self.api_config.clone() })) } @@ -80,7 +80,7 @@ impl Service for ApiService { type ReqBody = Body; type ResBody = Body; type Error = hyper::Error; - type Future = Box, Error = Self::Error> + Send>; + type Future = Box, Error = Self::Error> + Send>; fn call(&mut self, req: Request) -> Self::Future { let path = req.uri().path().to_owned(); @@ -115,7 +115,7 @@ fn get_request_parameters_async( parts: Parts, req_body: Body, uri_param: HashMap, -) -> Box + Send> +) -> Box + Send> { let mut is_json = false;