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 e993db91cd
commit dd5495d6dc
26 changed files with 83 additions and 81 deletions

View File

@ -54,7 +54,7 @@ fn read_etc_resolv_conf() -> Result<Value, Error> {
fn update_dns(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
lazy_static! {
@ -100,7 +100,7 @@ fn update_dns(
fn get_dns(
_param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
read_etc_resolv_conf()

View File

@ -10,7 +10,7 @@ use crate::api2::types::*;
fn get_network_config(
_param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
Ok(json!({}))

View File

@ -94,7 +94,7 @@ fn json_service_state(service: &str, status: Value) -> Value {
fn list_services(
_param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let mut list = vec![];
@ -117,7 +117,7 @@ fn list_services(
fn get_service_state(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let service = tools::required_string_param(&param, "service")?;
@ -162,7 +162,7 @@ fn run_service_command(service: &str, cmd: &str) -> Result<Value, Error> {
fn start_service(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let service = tools::required_string_param(&param, "service")?;
@ -175,7 +175,7 @@ fn start_service(
fn stop_service(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let service = tools::required_string_param(&param, "service")?;
@ -188,7 +188,7 @@ fn stop_service(
fn restart_service(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let service = tools::required_string_param(&param, "service")?;
@ -206,7 +206,7 @@ fn restart_service(
fn reload_service(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let service = tools::required_string_param(&param, "service")?;

View File

@ -76,7 +76,7 @@ fn dump_journal(
fn get_syslog(
param: Value,
_info: &ApiMethod,
rpcenv: &mut RpcEnvironment,
rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let (count, lines) = dump_journal(

View File

@ -14,7 +14,7 @@ use crate::server::{self, UPID};
fn get_task_status(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let upid = extract_upid(&param)?;
@ -56,7 +56,7 @@ fn extract_upid(param: &Value) -> Result<UPID, Error> {
fn read_task_log(
param: Value,
_info: &ApiMethod,
rpcenv: &mut RpcEnvironment,
rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let upid = extract_upid(&param)?;
@ -96,7 +96,7 @@ fn read_task_log(
fn stop_task(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let upid = extract_upid(&param)?;
@ -111,7 +111,7 @@ fn stop_task(
fn list_tasks(
param: Value,
_info: &ApiMethod,
rpcenv: &mut RpcEnvironment,
rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let start = param["start"].as_u64().unwrap_or(0);

View File

@ -35,7 +35,7 @@ fn read_etc_localtime() -> Result<String, Error> {
fn get_time(
_param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let datetime = Local::now();
@ -53,7 +53,7 @@ fn get_time(
fn set_timezone(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
_rpcenv: &mut dyn RpcEnvironment,
) -> Result<Value, Error> {
let timezone = tools::required_string_param(&param, "timezone")?;