From cab9252b4adc151c64aedc1498737542d91bafc1 Mon Sep 17 00:00:00 2001 From: MFijak Date: Sat, 17 Sep 2022 17:31:20 +0200 Subject: [PATCH] simplified access flag appending --- src/db/models/cipher.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/db/models/cipher.rs b/src/db/models/cipher.rs index b4446158..bbada234 100644 --- a/src/db/models/cipher.rs +++ b/src/db/models/cipher.rs @@ -411,15 +411,9 @@ impl Cipher { } rows } else { - let mut user_collections_access_flags = self.get_user_collections_access_flags(user_uuid, conn).await; - let mut group_collections_access_flags = self.get_group_collections_access_flags(user_uuid, conn).await; - - let mut result = Vec::new(); - - result.append(&mut user_collections_access_flags); - result.append(&mut group_collections_access_flags); - - result + let mut access_flags = self.get_user_collections_access_flags(user_uuid, conn).await; + access_flags.append(&mut self.get_group_collections_access_flags(user_uuid, conn).await); + access_flags }; if rows.is_empty() {