From 13f3635db2da1581b5063e2ce04cb48fdf4b7ea6 Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Tue, 9 Jun 2026 18:29:44 -0400 Subject: [PATCH] Fix clippy lints in backfill and libraries tests Keep `cargo clippy --tests` clean alongside the agentic-loop changes: alias backfill's five-element setup() tuple as SetupFixture (type_complexity) and build the single-library health map via std::slice::from_ref instead of cloning (unnecessary clone-to-slice). No behavior change. Co-Authored-By: Claude Fable 5 --- src/backfill.rs | 15 ++++++++++----- src/libraries.rs | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/backfill.rs b/src/backfill.rs index 34baa41..ec25fbb 100644 --- a/src/backfill.rs +++ b/src/backfill.rs @@ -529,16 +529,21 @@ mod tests { opentelemetry::Context::new() } - /// Build a tempdir-backed library + DAOs sharing a single in-memory - /// SQLite connection (so cross-table joins like - /// `list_unscanned_candidates` see consistent state). - fn setup() -> ( + /// Everything `setup` hands back to a test: tempdir, library, shared + /// connection, and the two DAOs. Aliased to keep clippy's + /// type-complexity lint satisfied. + type SetupFixture = ( TempDir, Library, Arc>, Arc>>, Arc>>, - ) { + ); + + /// Build a tempdir-backed library + DAOs sharing a single in-memory + /// SQLite connection (so cross-table joins like + /// `list_unscanned_candidates` see consistent state). + fn setup() -> SetupFixture { let tmp = TempDir::new().expect("tempdir"); let mut conn = in_memory_db_connection(); // Migration seeds library id=1 with a placeholder root; rewrite it diff --git a/src/libraries.rs b/src/libraries.rs index 6248cfa..55bf5c1 100644 --- a/src/libraries.rs +++ b/src/libraries.rs @@ -1052,7 +1052,7 @@ mod tests { enabled: true, excluded_dirs: Vec::new(), }; - let map = new_health_map(&[lib.clone()]); + let map = new_health_map(std::slice::from_ref(&lib)); // First probe: empty dir, no prior data — Online. let s1 = refresh_health(&map, &lib, false);