From ea5af6b0de1b69f063bc06ea3e43ec13d76eea50 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sat, 12 Sep 2026 19:49:17 +0200 Subject: [PATCH] refactor(cli): name the set `sort_unique` builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `sort_unique` collected its names into a `HashSet`, walked straight back out of it, and collected again, all in one expression — the set that does the deduplicating had no name. The only chain in the workspace that `perfectionist::collection_round_trip` flags. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01CWntUqQ2mPR1yxZNbAYNUg --- pnpm/crates/cli/src/cli_args/approve_builds.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pnpm/crates/cli/src/cli_args/approve_builds.rs b/pnpm/crates/cli/src/cli_args/approve_builds.rs index 7dedd72def..17f4f5c32f 100644 --- a/pnpm/crates/cli/src/cli_args/approve_builds.rs +++ b/pnpm/crates/cli/src/cli_args/approve_builds.rs @@ -288,7 +288,8 @@ pub(crate) fn clear_decided_ignored_builds( /// Deduplicate and sort `names` by code unit, matching pnpm's /// `sortUniqueStrings` (a `Set` then `lexCompare`). fn sort_unique(names: Vec) -> Vec { - let mut unique: Vec = names.into_iter().collect::>().into_iter().collect(); + let deduplicated: HashSet = names.into_iter().collect(); + let mut unique: Vec = deduplicated.into_iter().collect(); unique.sort(); unique }