From ae492c87ff66b9f2c8fec25a5ca917c438bf5858 Mon Sep 17 00:00:00 2001 From: aur-build Date: Sat, 21 Nov 2026 09:38:21 +0000 Subject: src: close the items the stricter detector surfaced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The auditor's two counterexamples were real, and fixing the detector exposed seventeen more items it had never listed. Each was checked individually rather than dispositioned in bulk, and the check changed what the right answer was: - `review::approve::withdraw` — gated. The CLI and the web UI both go through `usecase::withdraw_package`; nothing invokes this. tests/pipeline.rs pins its invariants, so it is gated rather than deleted: the test is the cover for an operation production has not grown yet. - `pipeline::dispatch::Pool::shutdown` — gated. Production runs the pool until the process exits; a test needs the join to assert on effects after the threads stop. Its two fields now carry a matching `cfg_attr(allow(dead_code))` because in a release build they are stored and never read. - `shims::{mkarchroot,makechrootpkg,makepkg,gpg,pacman,record}` — plain `pub(crate)`. `run` dispatches to them by tool name; no module outside `shims` names them and no test calls them. The tool names appear in test *strings*, which is not a caller. - `db::Writer::start`, `fetch::open`, `http::Req::form`, `http::Page::new`, `http::Panel::new`, `http::render::BuildRow` — plain `pub(crate)`, same reason: used only from inside their own module. - `db::AuditEntry::system` — deleted. `audit_system` builds the row through the free `audit()`; nothing ever called the constructor, production or otherwise. - `pkgver::Version::display` — deleted, a wrapper around `to_string` with no callers. - `http::Server`, `watch::Stale`, `pkgver::Version` — private inner module with a gated alias. `Server` is what `spawn` hands back and `main` holds without naming; `Stale` is what `stale_rows` returns to `http` and `ops`; `Version` is what `parse` returns. All three must stay nameable to those callers in shape but not in name, which is exactly what the inner-module alias gives. Measured on the release build's public surface: 466 reachable public names at the start of this goal, 402 now, newly-public set empty. --- src/fetch.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/fetch.rs') diff --git a/src/fetch.rs b/src/fetch.rs index 1d06051..bcbdbda 100644 --- a/src/fetch.rs +++ b/src/fetch.rs @@ -17,7 +17,8 @@ impl Read for Body { } } -pub fn open(url: &str) -> Result<(Body, Option)> { +/// Only `get` in this file opens a fetch result; the bare word `open` elsewhere is a variable, not this function. +pub(crate) fn open(url: &str) -> Result<(Body, Option)> { if let Some(path) = url.strip_prefix("file://") { let p = path.trim_start_matches('/'); let p = PathBuf::from(format!("/{p}")); -- cgit v1.2.3