From 587bbe615a4bbd4f9d2fb4136ebd3e07758c1ee6 Mon Sep 17 00:00:00 2001 From: weriomat Date: Tue, 10 Jun 2025 01:26:01 +0200 Subject: [PATCH] chore: add native deduplication to flake checks this should fix [#318](https://github.com/serokell/deploy-rs/issues/318) by deduplicating the flake paths with a Hashset --- src/cli.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 43990f5c..667724ce 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -727,8 +727,13 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> { let using_flakes = supports_flakes && !do_not_want_flakes; if !opts.skip_checks { - for deploy_flake in &deploy_flakes { - check_deployment(using_flakes, deploy_flake.repo, &opts.extra_build_args).await?; + let mut set = std::collections::HashSet::new(); + deploy_flakes.iter().for_each(|item| { + set.insert(item.repo); + }); + + for path in set { + check_deployment(using_flakes, path, &opts.extra_build_args).await?; } } let result_path = opts.result_path.as_deref();