aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin.rs
diff options
context:
space:
mode:
authorBlackDex <[email protected]>2022-07-10 16:39:38 +0200
committerBlackDex <[email protected]>2022-07-10 16:39:38 +0200
commit55d7c48b1da23770d8152724ad8b6c733739e64d (patch)
tree619ebee1c93b0648db28e038548e74d70312efbf /src/api/admin.rs
parentb64cf27038f04368af8f25aa80782d37471e6303 (diff)
downloadvaultwarden-55d7c48b1da23770d8152724ad8b6c733739e64d.tar.gz
vaultwarden-55d7c48b1da23770d8152724ad8b6c733739e64d.zip
Add more clippy checks for better code/readability
A bit inspired by @paolobarbolini from this commit at lettre https://github.com/lettre/lettre/pull/784 . I added a few more clippy lints here, and fixed the resulted issues. Overall i think this could help in preventing future issues, and maybe even peformance problems. It also makes some code a bit more clear. We could always add more if we want to, i left a few out which i think arn't that huge of an issue. Some like the `unused_async` are nice, which resulted in a few `async` removals. Some others are maybe a bit more estatic, like `string_to_string`, but i think it looks better to use `clone` in those cases instead of `to_string` while they already are a string.
Diffstat (limited to 'src/api/admin.rs')
-rw-r--r--src/api/admin.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/admin.rs b/src/api/admin.rs
index 2565445a..19638ef3 100644
--- a/src/api/admin.rs
+++ b/src/api/admin.rs
@@ -427,7 +427,7 @@ async fn update_user_org_type(data: Json<UserOrgTypeData>, _token: AdminToken, c
}
}
- user_to_edit.atype = new_type as i32;
+ user_to_edit.atype = new_type;
user_to_edit.save(&conn).await
}