From f552238586c3572e1b5c0bab1946cec1dc12136f Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Tue, 30 Jun 2026 19:19:48 +0200 Subject: [PATCH] =?UTF-8?q?refactor(modules):=20drop=20dead=20group=5Fcoll?= =?UTF-8?q?ection=5Frepo::list=5Ffor=5Fowner=20(=C2=A711.6=20review)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The single-kind `list_for_owner` was superseded by `list_all_for_owner` (the apply diff and `collection_report` both moved to it during the docs slice). It had no callers but, being `pub`, escaped the dead-code lint — removing it drops two unexercised SQL queries. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../manager-core/src/group_collection_repo.rs | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/crates/manager-core/src/group_collection_repo.rs b/crates/manager-core/src/group_collection_repo.rs index 14eb2c8..15eb86c 100644 --- a/crates/manager-core/src/group_collection_repo.rs +++ b/crates/manager-core/src/group_collection_repo.rs @@ -18,39 +18,6 @@ use sqlx::{PgPool, Postgres, Transaction}; use crate::config_resolver::CHAIN_LEVELS_CTE; -/// List the collection names of `kind` declared **directly at** `owner` (not -/// inherited), case-insensitively sorted. Used by `load_current` (apply diff) -/// and the read-only `collections ls`. -pub async fn list_for_owner( - pool: &PgPool, - owner: ScriptOwner, - kind: &str, -) -> Result, sqlx::Error> { - let rows: Vec<(String,)> = match owner { - ScriptOwner::App(a) => { - sqlx::query_as( - "SELECT name FROM group_collections \ - WHERE app_id = $1 AND kind = $2 ORDER BY LOWER(name)", - ) - .bind(a.into_inner()) - .bind(kind) - .fetch_all(pool) - .await? - } - ScriptOwner::Group(g) => { - sqlx::query_as( - "SELECT name FROM group_collections \ - WHERE group_id = $1 AND kind = $2 ORDER BY LOWER(name)", - ) - .bind(g.into_inner()) - .bind(kind) - .fetch_all(pool) - .await? - } - }; - Ok(rows.into_iter().map(|(n,)| n).collect()) -} - /// List **all** shared-collection declarations at `owner` as `(name, kind)` /// pairs, sorted. Used by the kind-aware apply diff and `collections ls`. pub async fn list_all_for_owner(