tree-wide: fix needless borrows

found and fixed via clippy

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-12-30 12:57:37 +01:00
parent a0c69902c8
commit 9a37bd6c84
104 changed files with 238 additions and 241 deletions

View File

@ -55,7 +55,7 @@ fn list_acls(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result<Value, Err
pub fn acl_commands() -> CommandLineInterface {
let cmd_def = CliCommandMap::new()
.insert("list", CliCommand::new(&&API_METHOD_LIST_ACLS))
.insert("list", CliCommand::new(&API_METHOD_LIST_ACLS))
.insert(
"update",
CliCommand::new(&api2::access::acl::API_METHOD_UPDATE_ACL)

View File

@ -93,7 +93,7 @@ async fn create_datastore(mut param: Value) -> Result<Value, Error> {
let mut client = connect_to_localhost()?;
let result = client.post(&"api2/json/config/datastore", Some(param)).await?;
let result = client.post("api2/json/config/datastore", Some(param)).await?;
view_task_result(&mut client, result, &output_format).await?;

View File

@ -73,8 +73,8 @@ fn show_openid_realm(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result<Va
pub fn openid_commands() -> CommandLineInterface {
let cmd_def = CliCommandMap::new()
.insert("list", CliCommand::new(&&API_METHOD_LIST_OPENID_REALMS))
.insert("show", CliCommand::new(&&API_METHOD_SHOW_OPENID_REALM)
.insert("list", CliCommand::new(&API_METHOD_LIST_OPENID_REALMS))
.insert("show", CliCommand::new(&API_METHOD_SHOW_OPENID_REALM)
.arg_param(&["realm"])
.completion_cb("realm", pbs_config::domains::complete_openid_realm_name)
)

View File

@ -75,7 +75,7 @@ fn show_remote(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result<Value, E
pub fn remote_commands() -> CommandLineInterface {
let cmd_def = CliCommandMap::new()
.insert("list", CliCommand::new(&&API_METHOD_LIST_REMOTES))
.insert("list", CliCommand::new(&API_METHOD_LIST_REMOTES))
.insert(
"show",
CliCommand::new(&API_METHOD_SHOW_REMOTE)

View File

@ -94,7 +94,7 @@ async fn show_current_traffic(param: Value) -> Result<Value, Error> {
let client = connect_to_localhost()?;
let mut result = client.get(&"api2/json/admin/traffic-control", None).await?;
let mut result = client.get("api2/json/admin/traffic-control", None).await?;
let mut data = result["data"].take();

View File

@ -171,7 +171,7 @@ fn list_permissions(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result<Val
pub fn user_commands() -> CommandLineInterface {
let cmd_def = CliCommandMap::new()
.insert("list", CliCommand::new(&&API_METHOD_LIST_USERS))
.insert("list", CliCommand::new(&API_METHOD_LIST_USERS))
.insert(
"create",
// fixme: howto handle password parameter?
@ -192,7 +192,7 @@ pub fn user_commands() -> CommandLineInterface {
)
.insert(
"list-tokens",
CliCommand::new(&&API_METHOD_LIST_TOKENS)
CliCommand::new(&API_METHOD_LIST_TOKENS)
.arg_param(&["userid"])
.completion_cb("userid", pbs_config::user::complete_userid)
)
@ -211,7 +211,7 @@ pub fn user_commands() -> CommandLineInterface {
)
.insert(
"permissions",
CliCommand::new(&&API_METHOD_LIST_PERMISSIONS)
CliCommand::new(&API_METHOD_LIST_PERMISSIONS)
.arg_param(&["auth-id"])
.completion_cb("auth-id", pbs_config::user::complete_authid)
.completion_cb("path", pbs_config::datastore::complete_acl_path)