clippy: is_some/none/ok/err/empty

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-01-19 10:27:59 +01:00
parent 397356096a
commit 3984a5fd77
22 changed files with 38 additions and 42 deletions

View File

@ -72,7 +72,7 @@ fn extract_acl_node_data(
}
}
for (group, roles) in &node.groups {
if let Some(_) = token_user {
if token_user.is_some() {
continue;
}
@ -210,7 +210,7 @@ pub fn update_acl(
let top_level_privs = user_info.lookup_privs(&current_auth_id, &["access", "acl"]);
if top_level_privs & PRIV_PERMISSIONS_MODIFY == 0 {
if let Some(_) = group {
if group.is_some() {
bail!("Unprivileged users are not allowed to create group ACL item.");
}