diff options
| author | aur-build <aur-build@localhost> | 2026-11-21 13:43:30 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-21 13:43:30 +0000 |
| commit | 7afffd1a0ca798dd5826c2e1881b09fe135dbcbd (patch) | |
| tree | 819ceee7916e55b51b26809bd48de237638d8629 /src/db/snapshots.rs | |
| parent | 864bb0bc3181ff57f4b8a30c4fc4ac4099185ba9 (diff) | |
| download | aur-build-7afffd1a0ca798dd5826c2e1881b09fe135dbcbd.tar.gz aur-build-7afffd1a0ca798dd5826c2e1881b09fe135dbcbd.zip | |
src: delete the fields nothing reads, and the two knobs nothing obeys
The census only sees `pub` items, so the constructs below it stayed invisible
until narrowing made the compiler look: rustc reported `ReviewSubject::pkgbase`,
`StageB::cached` and `StageB::version` as dead the moment their structs stopped
being exported, and the same question asked of every struct field, enum variant
and SQL literal in the crate found six more.
`BuildRow::lease_owner` and `BuildRow::priority` were selected out of the
database into a row nobody read; the *columns* are live — the dispatcher leases
through one and orders by the other — so the SELECT list and the row mapper lost
them and the schema did not. `Pkgbase::unpinable` and `SnapshotRow::files_json`
are the same shape, and `Config::git_bin` and `Config::build_user` are worse:
they are knobs an operator can set, defaulted, serialized, and consulted by
nothing. A setting that changes nothing is not an unimplemented feature, it is a
lie in a config file, so both are gone; `a_config_init_wrote_before_the_enum_
still_loads` now proves a config that still names them loads anyway.
Two axes came back empty, and both were checked rather than assumed: every string
literal containing SQL is passed to a call, and the two `Error` variants that
name matches never mention — `Json` and `Sqlite` — are constructed by `?` in
about a hundred places, which is why they were left alone. Every template and
every static asset is reachable from a route or an `extends`.
Diffstat (limited to 'src/db/snapshots.rs')
| -rw-r--r-- | src/db/snapshots.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/db/snapshots.rs b/src/db/snapshots.rs index e227eca..7966c8b 100644 --- a/src/db/snapshots.rs +++ b/src/db/snapshots.rs @@ -44,7 +44,6 @@ pub struct SnapshotRow { pub aur_commit: String, pub recipe_hash: String, pub srcinfo_json: String, - pub files_json: String, } /// Find a snapshot by the commit it was taken at. @@ -55,7 +54,7 @@ pub struct SnapshotRow { pub fn snapshot_by_commit(db: &Db, pkgbase_id: i64, commit: &str) -> Result<Option<SnapshotRow>> { db.read(|c| { c.query_row( - "SELECT id, aur_commit, recipe_hash, srcinfo_json, files_json FROM snapshot + "SELECT id, aur_commit, recipe_hash, srcinfo_json FROM snapshot WHERE pkgbase_id=?1 AND aur_commit=?2", params![pkgbase_id, commit], |r| { @@ -64,7 +63,6 @@ pub fn snapshot_by_commit(db: &Db, pkgbase_id: i64, commit: &str) -> Result<Opti aur_commit: r.get(1)?, recipe_hash: r.get(2)?, srcinfo_json: r.get(3)?, - files_json: r.get(4)?, }) }, ) @@ -76,7 +74,7 @@ pub fn snapshot_by_commit(db: &Db, pkgbase_id: i64, commit: &str) -> Result<Opti pub fn snapshot_by_id(db: &Db, id: i64) -> Result<Option<SnapshotRow>> { db.read(|c| { c.query_row( - "SELECT id, aur_commit, recipe_hash, srcinfo_json, files_json FROM snapshot WHERE id=?1", + "SELECT id, aur_commit, recipe_hash, srcinfo_json FROM snapshot WHERE id=?1", params![id], |r| { Ok(SnapshotRow { @@ -84,7 +82,6 @@ pub fn snapshot_by_id(db: &Db, id: i64) -> Result<Option<SnapshotRow>> { aur_commit: r.get(1)?, recipe_hash: r.get(2)?, srcinfo_json: r.get(3)?, - files_json: r.get(4)?, }) }, ) |
