From 7ccfb9a8f96b6f3000f36bdf76d95a4f6afd2826 Mon Sep 17 00:00:00 2001 From: aur-build Date: Sat, 21 Nov 2026 11:05:43 +0000 Subject: db: delete two candidate queries nothing in production calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `open_reviews_for` and `reopen_rejected` were both declared in `db`, both re-exported by `review::candidates`, and both reached by nobody in `src`. The auditor found them; the reason they stayed invisible is in the next commit. `reopen_rejected` is simply gone: no caller, no test, nothing to lose. `open_reviews_for` was a test convenience — `tests/detect.rs` used it to fetch "the pending candidate for this pkgbase". The production query `pending` already returns pending candidates and `CandidateRow` carries `pkgbase_id`, so the test now filters that instead. Same assertion, same rows, one fewer public function that existed only because a test wanted it. --- tests/detect.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/detect.rs b/tests/detect.rs index 86d1315..7edc529 100644 --- a/tests/detect.rs +++ b/tests/detect.rs @@ -17,7 +17,10 @@ fn seed(env: &Env, name: &str, pkgver: &str, pkgrel: &str, extra: &str) -> Strin fn pending(env: &Env, name: &str) -> Option { let pb = db::get_pkgbase(&env.db, name).unwrap().unwrap(); - candidates::open_reviews_for(&env.db, pb.id).unwrap().into_iter().next() + candidates::pending_candidates(&env.db) + .unwrap() + .into_iter() + .find(|c| c.pkgbase_id == pb.id) } fn accepted(env: &Env, name: &str) -> Option { -- cgit v1.2.3