From 35f528eb57922d554460f764bb0c3ab8617e361c Mon Sep 17 00:00:00 2001 From: MFijak Date: Wed, 3 Aug 2022 08:24:35 +0200 Subject: [PATCH] fix clippy warnings --- src/api/core/organizations.rs | 6 +++--- src/db/models/collection.rs | 2 +- src/db/models/group.rs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index 98134ce7..ae97bceb 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -1594,7 +1594,7 @@ impl SelectionReadOnly { pub fn to_collection_group (&self, groups_uuid: String) -> CollectionGroup { CollectionGroup::new ( self.Id.clone(), - groups_uuid.clone(), + groups_uuid, self.ReadOnly, self.HidePasswords ) @@ -1656,12 +1656,12 @@ async fn put_group(_org_id: String, group_id: String, data: JsonUpcase, conn: &DbConn) -> JsonResult { - group.save(&conn).await?; + group.save(conn).await?; for selection_read_only_request in collections { let mut collection_group = selection_read_only_request.to_collection_group(group.uuid.clone()); - collection_group.save(&conn).await?; + collection_group.save(conn).await?; } Ok(Json(json!({ diff --git a/src/db/models/collection.rs b/src/db/models/collection.rs index ef17a3ed..263ce3e3 100644 --- a/src/db/models/collection.rs +++ b/src/db/models/collection.rs @@ -127,7 +127,7 @@ impl Collection { self.update_users_revision(conn).await; CollectionCipher::delete_all_by_collection(&self.uuid, conn).await?; CollectionUser::delete_all_by_collection(&self.uuid, conn).await?; - CollectionGroup::delete_all_by_collection(&self.uuid, &conn).await?; + CollectionGroup::delete_all_by_collection(&self.uuid, conn).await?; db_run! { conn: { diesel::delete(collections::table.filter(collections::uuid.eq(self.uuid))) diff --git a/src/db/models/group.rs b/src/db/models/group.rs index dfc6a025..5f68fa5c 100644 --- a/src/db/models/group.rs +++ b/src/db/models/group.rs @@ -41,10 +41,10 @@ impl Group { Self { uuid: crate::util::get_uuid(), - organizations_uuid: organizations_uuid, - name: name, - access_all: access_all, - external_id: external_id, + organizations_uuid, + name, + access_all, + external_id, creation_date: now, revision_date: now } @@ -79,8 +79,8 @@ impl CollectionGroup { impl GroupUser { pub fn new (groups_uuid: String, users_organizations_uuid: String) -> Self { Self { - groups_uuid: groups_uuid, - users_organizations_uuid: users_organizations_uuid + groups_uuid, + users_organizations_uuid } } } @@ -183,8 +183,8 @@ impl Group { } pub async fn delete(&self, conn: &DbConn) -> EmptyResult { - CollectionGroup::delete_all_by_group(&self.uuid, &conn).await?; - GroupUser::delete_all_by_group(&self.uuid, &conn).await?; + CollectionGroup::delete_all_by_group(&self.uuid, conn).await?; + GroupUser::delete_all_by_group(&self.uuid, conn).await?; db_run! { conn: { diesel::delete(groups::table.filter(groups::uuid.eq(&self.uuid)))