Skip to content

fix(jcode-tui): gate cache_expected_warm re-export behind #[cfg(test)] to clear unused-import under -D warnings #149

Open

Description

@KooshaPari

Symptom

cargo clippy -p jcode-tui --all-targets --all-features -- -D warnings (Quality Guardrails CI) emits:

warning: unused import: `kv_cache_problem::cache_expected_warm`
 --> crates/jcode-tui/src/tui/mod.rs:1070:16

The file is crates/jcode-tui/src/tui/mod.rs; the import lives at line 1070 on master (line shifts by +/- 2 across branches because of the rustfmt drift fixed by PR #129).

Under -D warnings this becomes a hard error and the Quality Guardrails gate fails.

Root cause

pub(crate) use kv_cache_problem::cache_expected_warm; was added unconditionally by commit 55d4432 to fix an E0425 path error in the test block (the test uses super::cache_expected_warm). The function has exactly one consumer in the entire crate and that consumer is the #[cfg(test)] mod tests block at crates/jcode-tui/src/tui/mod.rs:1883 and :1885.

The neighbouring KvCacheProblemKind re-export on line 1072 is already #[cfg(test)]-gated. cache_expected_warm should be gated the same way.

Proposed fix

Mirror the existing #[cfg(test)] gating on KvCacheProblemKind. The diff is 1 deletion + 2 insertions in a single file, no behavioural change. Both test-only re-exports are kept under one cfg group so the import block is unchanged in shape.

Independent of

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions