diff options
| author | aur-build <aur-build@localhost> | 2026-11-21 13:28:55 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-21 13:28:55 +0000 |
| commit | 48fecfe03be4f214eaf4f9c49cb3c27496bb74ba (patch) | |
| tree | 432f6e32351df60d36a115561c1bf8b8013c5430 /src/pkginfo.rs | |
| parent | a200edaac2056dd9c85d6bddff3ca181f0cc277e (diff) | |
| download | aur-build-48fecfe03be4f214eaf4f9c49cb3c27496bb74ba.tar.gz aur-build-48fecfe03be4f214eaf4f9c49cb3c27496bb74ba.zip | |
src: narrow what only its own module reads, and delete what nothing reads at all
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.
Diffstat (limited to 'src/pkginfo.rs')
| -rw-r--r-- | src/pkginfo.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkginfo.rs b/src/pkginfo.rs index 2cf449e..470ccf7 100644 --- a/src/pkginfo.rs +++ b/src/pkginfo.rs @@ -1,6 +1,7 @@ use std::io::Read; #[derive(Debug, Clone, Default, PartialEq, Eq)] +// PkgInfo stays `pub`: what `parse_pkginfo` answers with; `pipeline`, `shims` and tests/world.rs read its fields, never its name. pub struct PkgInfo { pub name: String, pub version: String, @@ -19,6 +20,7 @@ pub struct PkgInfo { } #[derive(Debug, Clone, PartialEq, Eq)] +// Installed stays `pub`: what `parse_installed` answers with, read line by line by `pipeline` and tests/world.rs. pub struct Installed { pub name: String, pub version: String, |
