From e1b8201def29099b5a48d08eaab49d7e3c3bfa20 Mon Sep 17 00:00:00 2001 From: Edoardo Marangoni Date: Tue, 16 Jul 2024 17:03:35 +0200 Subject: [PATCH] fix(backend-api): Remove useless sanity checks --- lib/backend-api/src/query.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/backend-api/src/query.rs b/lib/backend-api/src/query.rs index d4839cdfc38..0fae804ef5f 100644 --- a/lib/backend-api/src/query.rs +++ b/lib/backend-api/src/query.rs @@ -101,7 +101,7 @@ pub async fn get_all_app_secrets_filtered( names: Some(names.into_iter().map(|s| s.into()).collect()), }; - let mut all_versions = Vec::::new(); + let mut all_secrets = Vec::::new(); loop { let page = get_app_secrets(client, vars.clone()).await?; @@ -119,17 +119,14 @@ pub async fn get_all_app_secrets_filtered( None => continue, }; - // Sanity check to avoid duplication. - if all_versions.iter().any(|v| v.id == version.id) == false { - all_versions.push(version); - } + all_secrets.push(version); // Update pagination. vars.after = Some(edge.cursor); } } - Ok(all_versions) + Ok(all_secrets) } /// Load all secrets of an app. @@ -149,7 +146,7 @@ pub async fn get_all_app_secrets( names: None, }; - let mut all_versions = Vec::::new(); + let mut all_secrets = Vec::::new(); loop { let page = get_app_secrets(client, vars.clone()).await?; @@ -167,17 +164,14 @@ pub async fn get_all_app_secrets( None => continue, }; - // Sanity check to avoid duplication. - if all_versions.iter().any(|v| v.id == version.id) == false { - all_versions.push(version); - } + all_secrets.push(version); // Update pagination. vars.after = Some(edge.cursor); } } - Ok(all_versions) + Ok(all_secrets) } /// Retrieve secrets for an app.