aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/admin.rs')
-rw-r--r--src/api/admin.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/api/admin.rs b/src/api/admin.rs
index 45eb5972..f49f6ed3 100644
--- a/src/api/admin.rs
+++ b/src/api/admin.rs
@@ -495,11 +495,11 @@ struct UserOrgTypeData {
async fn update_user_org_type(data: Json<UserOrgTypeData>, token: AdminToken, mut conn: DbConn) -> EmptyResult {
let data: UserOrgTypeData = data.into_inner();
- let mut user_to_edit =
- match UserOrganization::find_by_user_and_org(&data.user_uuid, &data.org_uuid, &mut conn).await {
- Some(user) => user,
- None => err!("The specified user isn't member of the organization"),
- };
+ let Some(mut user_to_edit) =
+ UserOrganization::find_by_user_and_org(&data.user_uuid, &data.org_uuid, &mut conn).await
+ else {
+ err!("The specified user isn't member of the organization")
+ };
let new_type = match UserOrgType::from_str(&data.user_type.into_string()) {
Some(new_type) => new_type as i32,
@@ -602,9 +602,8 @@ async fn get_json_api<T: DeserializeOwned>(url: &str) -> Result<T, Error> {
}
async fn has_http_access() -> bool {
- let req = match make_http_request(Method::HEAD, "https://github.com/dani-garcia/vaultwarden") {
- Ok(r) => r,
- Err(_) => return false,
+ let Ok(req) = make_http_request(Method::HEAD, "https://github.com/dani-garcia/vaultwarden") else {
+ return false;
};
match req.send().await {
Ok(r) => r.status().is_success(),