From 48fecfe03be4f214eaf4f9c49cb3c27496bb74ba Mon Sep 17 00:00:00 2001 From: aur-build Date: Sat, 21 Nov 2026 13:28:55 +0000 Subject: src: narrow what only its own module reads, and delete what nothing reads at all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The census's 35 `deadonly` items were a lead, not a verdict, and the compiler answered it: 17 of them are read only inside their own module and were declared `pub` for no reason, so they are `pub(crate)` now — `db::OpenReview` and its two queries, `ReviewSubject` and its query, `fetch::Body`, `http`'s `form_get`, `query_get` and `Page::flash`, `ops::EvictPlan`, `usecase`'s `StageB`… — and two are read by nobody: `ReleaseState::can_transition` and `SubscriptionState::can_transition`, both already annotated "nothing consults this table today", which is the definition of dead rather than the argument for keeping. Narrowing them is what made the compiler look harder, and it found three more: `ReviewSubject::pkgbase` was selected out of the database and never read, `StageB::cached` was written in three places and never read, and `StageB::version` was never called. All gone, the SELECT column with them. The other 18 cannot be narrowed and now say so, once at the declaration and once in the budget file: a row type the `aur-build` binary binds without naming (`PackageRow`, `Checked`, `GcPlan`, `Prepared`), a type behind a `pub` fn a test calls (`Unbuilt`, `BulkItem`, `StageA`, `CheckReport`, `PkgInfo`, `Installed`, `Subscription`, `Manifest`), a trait a public test provisioner implements (`Provisioner`, `ProvisionRequest`), and three that a release build never even compiles because their module is `test-support`-gated (`shims::*`, `VirtualClock`). `deadonly` therefore means *dead and unargued* now: an allowlisted item leaves the dead columns, which is the only way the number can be held at zero forever. 448 pub, 49 dead, 0 unargued; 284 tests pass, one ignored, none lost. --- src/watch/mirror.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/watch/mirror.rs') diff --git a/src/watch/mirror.rs b/src/watch/mirror.rs index d7c793b..5b7e2b1 100644 --- a/src/watch/mirror.rs +++ b/src/watch/mirror.rs @@ -69,7 +69,7 @@ impl Tree { pub fn recipe_hash(&self) -> String { crate::hash::recipe_hash(&self.blobs) } - pub fn json_list(&self) -> String { + pub(crate) fn json_list(&self) -> String { serde_json::to_string(&self.blobs).unwrap_or_else(|_| "[]".into()) } } -- cgit v1.2.3