From ffdc842ec3f1245ef76e4c6f1a0e7ef2938fc80b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Apr 2026 06:41:15 -0500 Subject: [PATCH] ingestd: scope test-only imports into the test module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit schema_evolution.rs had two `#[allow(unused_imports)]` attributes hiding over-broad top-level imports: - `Schema` was imported at crate level but only used in test code - `Arc` was imported at crate level but only used in test code - `DataType` and `SchemaRef` were actually used (28 references) — the allow on that line was cargo-culted. Fix: drop the allows, move Schema + Arc into the #[cfg(test)] block where they're actually used. The non-test build no longer imports symbols it doesn't need. Test build still works because the imports are now in the test module's scope. Workspace warnings still at 0 (lib + tests). Net: -3 import lines from crate scope, +2 into test scope. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/ingestd/src/schema_evolution.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/ingestd/src/schema_evolution.rs b/crates/ingestd/src/schema_evolution.rs index fa7db93..1f7f8e9 100644 --- a/crates/ingestd/src/schema_evolution.rs +++ b/crates/ingestd/src/schema_evolution.rs @@ -2,12 +2,9 @@ /// When a source changes format (columns renamed, added, removed, type changed), /// the system detects the diff and can auto-map using AI or heuristic matching. -#[allow(unused_imports)] -use arrow::datatypes::{DataType, Schema, SchemaRef}; +use arrow::datatypes::{DataType, SchemaRef}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; -#[allow(unused_imports)] -use std::sync::Arc; /// A detected change between two schema versions. #[derive(Debug, Clone, Serialize, Deserialize)] @@ -225,7 +222,8 @@ fn find_similar_column<'a>( #[cfg(test)] mod tests { use super::*; - use arrow::datatypes::Field; + use arrow::datatypes::{Field, Schema}; + use std::sync::Arc; fn schema(fields: Vec<(&str, DataType)>) -> SchemaRef { Arc::new(Schema::new(