diff options
| author | dev <dev@localhost> | 2026-11-20 17:13:44 +0000 |
|---|---|---|
| committer | dev <dev@localhost> | 2026-11-20 17:13:44 +0000 |
| commit | 8cd32e5309b14f5264813e5f2ce6ecdb5aa41fb4 (patch) | |
| tree | 2ce6c30a688ef3fb15af5639e22cfc230f8f3627 /src/urlutil.rs | |
| parent | b73bb60403c3f2e7fc55d5038831912e8371e3a6 (diff) | |
| download | aur-build-8cd32e5309b14f5264813e5f2ce6ecdb5aa41fb4.tar.gz aur-build-8cd32e5309b14f5264813e5f2ce6ecdb5aa41fb4.zip | |
db: one module per aggregate, and an interface you can read
queries.rs was 1,501 lines holding 83 queries across seventeen aggregates,
separated by comment banners that said "settings", "release", "notices" and
then kept them in one file. The banners were the design; they just never got
files. Each one has one now, verbatim — the split is provably content-only,
the moved text being identical to the original as a sorted set of lines.
model.rs and builds.rs were each two concerns deep, so they became
directories. model.rs held what a row looks like and, separately, the state
machines that say which moves are legal; builds.rs held the build machine and,
below its own `step rows` banner, the step machine. The impl_state_enum!
macro implements StateEnum for all five enums from one place, so it moved
with its invocations rather than being exported across a boundary to chase
them.
They are directories rather than new sibling modules on purpose:
`db::model::CandidateState` and `db::builds::steps` are used across the crate
and by the integration tests, and renaming them would be a bigger change than
the one being made. No call site and no test changed.
db/mod.rs now lists its interface instead of spraying one. `pub use model::*`
and `pub use queries::*` are gone, replaced by seventeen explicit exports, and
the query modules are private — so a query that was not chosen for export is
not reachable, and the width of the module is visible from its own text
rather than only from a grep.
The ratchet caught the win immediately: db.glob went 2 -> 0, which failed
a_shrunk_interface_is_written_back until the budget was written back at the
new value. db is off the glob allowlist now rather than holding a stale zero.
277 passed / 0 failed, clippy -D warnings clean, largest file in src/db 363
lines (candidates.rs, unchanged from before this work).
Diffstat (limited to 'src/urlutil.rs')
0 files changed, 0 insertions, 0 deletions
