tree-wide: use 'dyn' for all trait objects

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-06-07 13:10:56 +02:00
parent e8a799cf06
commit a99f7ec987
2 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ pub struct ErrorMessageExtension(pub String);
pub struct OutputFormatter {
pub format_data: fn(data: Value, rpcenv: &RpcEnvironment) -> Response<Body>,
pub format_data: fn(data: Value, rpcenv: &dyn RpcEnvironment) -> Response<Body>,
pub format_error: fn(err: Error) -> Response<Body>,
}
@ -39,7 +39,7 @@ pub fn json_data_response(data: Value) -> Response<Body> {
response
}
fn json_format_data(data: Value, rpcenv: &RpcEnvironment) -> Response<Body> {
fn json_format_data(data: Value, rpcenv: &dyn RpcEnvironment) -> Response<Body> {
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<Body> {
fn extjs_format_data(data: Value, rpcenv: &dyn RpcEnvironment) -> Response<Body> {
let mut result = json!({
"data": data,

View File

@ -47,7 +47,7 @@ impl NewService for RestServer
type Error = hyper::Error;
type InitError = hyper::Error;
type Service = ApiService;
type Future = Box<Future<Item = Self::Service, Error = Self::InitError> + Send>;
type Future = Box<dyn Future<Item = Self::Service, Error = Self::InitError> + 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<Future<Item = Response<Body>, Error = Self::Error> + Send>;
type Future = Box<dyn Future<Item = Response<Body>, Error = Self::Error> + Send>;
fn call(&mut self, req: Request<Self::ReqBody>) -> 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<String, String>,
) -> Box<Future<Item = Value, Error = failure::Error> + Send>
) -> Box<dyn Future<Item = Value, Error = failure::Error> + Send>
{
let mut is_json = false;