From 3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 Mon Sep 17 00:00:00 2001 From: aur-build Date: Sun, 22 Nov 2026 10:36:24 +0000 Subject: rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off rustfmt.toml fixes the shape the tree is written in (120 columns, small items kept on one line) and one canonical pass makes it the truth. [lints.clippy] names the idiom lints worth enforcing and leaves out the two that would add doc-comment boilerplate rather than remove it. The tree pays them off here: write!/writeln! instead of push_str(&format!()), let-else instead of match-on-Option, borrows where a thread entry point only reads what it owns, no `&self` on a Copy state and no `self` nobody reads. ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and value are now emitted by the same call instead of three. --- src/db/migrations.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/db/migrations.rs') diff --git a/src/db/migrations.rs b/src/db/migrations.rs index 7adc69c..2e552f2 100644 --- a/src/db/migrations.rs +++ b/src/db/migrations.rs @@ -5,7 +5,7 @@ pub struct Migration { pub sql: &'static str, } -const M_0001_CORE: &str = r#" +const M_0001_CORE: &str = r" -- The single repo we publish. Exactly one row. CREATE TABLE repo ( id INTEGER PRIMARY KEY, @@ -170,9 +170,9 @@ CREATE TABLE package ( state TEXT NOT NULL DEFAULT 'in_index' -- in_index | removed ); CREATE INDEX package_by_name ON package (repo_id, name, state); -"#; +"; -const M_0002_BUILD: &str = r#" +const M_0002_BUILD: &str = r" CREATE TABLE build ( id TEXT PRIMARY KEY, -- deterministic intent hash pkgbase_id INTEGER NOT NULL REFERENCES pkgbase(id), @@ -209,7 +209,7 @@ CREATE TABLE build_step ( finished_at TEXT, PRIMARY KEY (build_id, step) ); -"#; +"; const M_0003_NOTICES: &str = r#" -- "something changed but nothing is publishable". @@ -253,7 +253,7 @@ CREATE TABLE dep_edge ( ); "#; -const M_0004_TRIGGERS: &str = r#" +const M_0004_TRIGGERS: &str = r" -- The audit log is append-only. CREATE TRIGGER audit_no_update BEFORE UPDATE ON audit @@ -266,14 +266,14 @@ BEFORE DELETE ON audit BEGIN SELECT RAISE(ABORT, 'audit log is append-only: deletes are forbidden'); END; -"#; +"; -const M_0005_ARTIFACT_BUILD: &str = r#" +const M_0005_ARTIFACT_BUILD: &str = r" ALTER TABLE artifact ADD COLUMN build_id TEXT; CREATE INDEX artifact_by_build ON artifact (build_id); -"#; +"; -const M_0006_APPROVAL_IMMUTABLE: &str = r#" +const M_0006_APPROVAL_IMMUTABLE: &str = r" CREATE TRIGGER approval_no_update BEFORE UPDATE ON approval BEGIN @@ -285,9 +285,9 @@ BEFORE DELETE ON approval BEGIN SELECT RAISE(ABORT, 'approval records are immutable'); END; -"#; +"; -const M_0007_STAGE_B_CACHE: &str = r#" +const M_0007_STAGE_B_CACHE: &str = r" CREATE TABLE stage_b_cache ( pkgbase_id INTEGER NOT NULL REFERENCES pkgbase(id), recipe_hash TEXT NOT NULL, @@ -301,7 +301,7 @@ CREATE TABLE stage_b_cache ( ); CREATE INDEX stage_b_cache_by_pkgbase ON stage_b_cache (pkgbase_id, resolved_at); -"#; +"; const M_0008_RETENTION: &str = r#" ALTER TABLE artifact ADD COLUMN purged_at TEXT; -- cgit v1.2.3