summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordev <dev@example.com>2026-11-21 19:25:47 +0000
committerdev <dev@example.com>2026-11-21 19:25:47 +0000
commit533835c6b49111d5520ccd7a7bdd008a428b560f (patch)
tree4947b0faa66420012050c600d0d1119d55cd4a43 /src
parentdb11b540b1b4c60926c175cb5cd043c7555b99f3 (diff)
downloadaur-build-533835c6b49111d5520ccd7a7bdd008a428b560f.tar.gz
aur-build-533835c6b49111d5520ccd7a7bdd008a428b560f.zip
config,db,fetch,ops: eleven pub(crate) items nothing outside their own file reaches
Every one of these was found by taking the marker off and asking the compiler, under both profiles, not by reading a grep. `cargo check --all-targets` builds with `test-support` on, so it never compiles the `cfg(not(test-support))` half of a feature-conditional declaration; the release check is the one that says whether that half can go private, and it refused several of them that the dev check appeared to accept. Narrowed to private: config `shared_workspace` and `store_dir` (both are the `cfg(not(test-support))` twin of a `pub` that only tests reach), db `state_col`, `start`, `call`, `send`, fetch `Body` and `open`, ops `build_success_rate`, `STAGING_GRACE_SECS` and `sweep_staging`. Refused, and now argued in the budget file rather than left unexplained: `EvictPlan`, because `plan_retention` is `pub(crate)` and returns `Vec<EvictPlan>`, so a private row type is `error: type EvictPlan is private` at `usecase/maintenance.rs:23` where the Vec is bound. `Readers`, `OpenReview` and `ReviewSubject` are the same story in `db`. priv 170 -> 159, overwide 27 -> 22. `cargo check` clean under both profiles with no new warnings, including no new dead_code; `cargo test --test architecture` 16 passed.
Diffstat (limited to 'src')
-rw-r--r--src/config.rs4
-rw-r--r--src/db/mod.rs8
-rw-r--r--src/fetch.rs4
-rw-r--r--src/ops.rs6
4 files changed, 11 insertions, 11 deletions
diff --git a/src/config.rs b/src/config.rs
index 958fb0f..7818e4b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -100,7 +100,7 @@ impl Sandbox {
}
#[cfg(not(feature = "test-support"))]
- pub(crate) fn shared_workspace(&self) -> bool {
+ fn shared_workspace(&self) -> bool {
Self::shared_workspace_impl(self)
}
@@ -376,7 +376,7 @@ impl Config {
}
#[cfg(not(feature = "test-support"))]
- pub(crate) fn store_dir(&self) -> PathBuf {
+ fn store_dir(&self) -> PathBuf {
Self::store_dir_impl(self)
}
diff --git a/src/db/mod.rs b/src/db/mod.rs
index bf54be1..4379a5f 100644
--- a/src/db/mod.rs
+++ b/src/db/mod.rs
@@ -99,7 +99,7 @@ pub use world::put_world_snapshot;
#[cfg(feature = "test-support")]
pub use world::world_members;
-pub(crate) fn state_col<T: StateEnum>(col: usize, text: &str) -> rusqlite::Result<T> {
+fn state_col<T: StateEnum>(col: usize, text: &str) -> rusqlite::Result<T> {
T::parse(text).ok_or_else(|| {
rusqlite::Error::FromSqlConversionFailure(
col,
@@ -196,7 +196,7 @@ pub struct Writer {
impl Writer {
/// Only `Writer::open` in this module starts a writer.
- pub(crate) fn start(path: &Path) -> Result<Self> {
+ fn start(path: &Path) -> Result<Self> {
let conn = open(path, false)?;
let (tx, rx) = unbounded::<Msg>();
let alive = Arc::new(AtomicBool::new(true));
@@ -229,7 +229,7 @@ impl Writer {
self.alive.load(Ordering::SeqCst)
}
- pub(crate) fn call<T>(&self, f: impl FnOnce(&mut Connection) -> Result<T> + Send + 'static) -> Result<T>
+ fn call<T>(&self, f: impl FnOnce(&mut Connection) -> Result<T> + Send + 'static) -> Result<T>
where
T: Send + 'static,
{
@@ -259,7 +259,7 @@ impl Writer {
})
}
- pub(crate) fn send(&self, f: BoxedCall) -> Result<()> {
+ fn send(&self, f: BoxedCall) -> Result<()> {
if !self.is_alive() {
return Err(Error::db("writer actor gone"));
}
diff --git a/src/fetch.rs b/src/fetch.rs
index fd9a661..98876bc 100644
--- a/src/fetch.rs
+++ b/src/fetch.rs
@@ -3,7 +3,7 @@ use std::path::PathBuf;
use crate::error::{Error, Result};
-pub(crate) enum Body {
+enum Body {
File(std::fs::File),
Http(Box<dyn Read + Send>),
}
@@ -18,7 +18,7 @@ impl Read for Body {
}
/// 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<u64>)> {
+fn open(url: &str) -> Result<(Body, Option<u64>)> {
if let Some(path) = url.strip_prefix("file://") {
let p = path.trim_start_matches('/');
let p = PathBuf::from(format!("/{p}"));
diff --git a/src/ops.rs b/src/ops.rs
index d43c528..0afda76 100644
--- a/src/ops.rs
+++ b/src/ops.rs
@@ -53,7 +53,7 @@ impl Metrics {
}
#[cfg(not(feature = "test-support"))]
- pub(crate) fn build_success_rate(&self) -> f64 {
+ fn build_success_rate(&self) -> f64 {
Self::build_success_rate_impl(self)
}
@@ -333,7 +333,7 @@ const STAGING_GRACE_SECS_VALUE: i64 = 3600;
pub const STAGING_GRACE_SECS: i64 = STAGING_GRACE_SECS_VALUE;
#[cfg(not(feature = "test-support"))]
-pub(crate) const STAGING_GRACE_SECS: i64 = STAGING_GRACE_SECS_VALUE;
+const STAGING_GRACE_SECS: i64 = STAGING_GRACE_SECS_VALUE;
pub fn release_files(cfg: &Config, db: &Db, release_id: i64) -> Result<Vec<PathBuf>> {
let mut out = Vec::new();
@@ -365,7 +365,7 @@ pub fn sweep_staging(cfg: &Config, db: &Db, grace_secs: i64) -> Result<(usize, u
}
#[cfg(not(feature = "test-support"))]
-pub(crate) fn sweep_staging(cfg: &Config, db: &Db, grace_secs: i64) -> Result<(usize, u64)> {
+fn sweep_staging(cfg: &Config, db: &Db, grace_secs: i64) -> Result<(usize, u64)> {
sweep_staging_impl(cfg, db, grace_secs)
}