clippy: remove unnecessary clones

and from::<T>(T)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-01-15 14:38:27 +01:00
parent 47ea98e0e3
commit 4428818412
35 changed files with 47 additions and 51 deletions

View File

@ -46,7 +46,7 @@ fn list_roles() -> Result<Value, Error> {
let mut priv_list = Vec::new();
for (name, privilege) in PRIVILEGES.iter() {
if privs & privilege > 0 {
priv_list.push(name.clone());
priv_list.push(name);
}
}
list.push(json!({ "roleid": role, "privs": priv_list, "comment": comment }));

View File

@ -603,7 +603,7 @@ pub fn generate_token(
token_shadow::set_secret(&tokenid, &secret)?;
let token = user::ApiToken {
tokenid: tokenid.clone(),
tokenid,
comment,
enable,
expire,