Skip to content

clippy: two pre-existing -D warnings failures (block local validation with strict clippy) #532

Closed

Description

@ajianaz

What

Two warnings fire under `cargo clippy --all-targets -- -D warnings` on current `develop` (verified identical before any of the open PRs), failing strict clippy locally. CI may pass with a different toolchain, but per AGENT.md this command is the project lint bar.

Findings

  1. Duplicated attribute — `src/index/ast.rs:6`: module-level #![cfg(feature = "tree-sitter")] while the declaration in `src/index/mod.rs:7` is already cfg-gated.
  2. Collapsible else-if — `src/main.rs` (~line 1161–1186, shifts between branches): an `else { if … }` block can be collapsed to `else if`.

Suggested fix

  1. Remove the inner `#![cfg(...)]` attribute from `ast.rs` (or drop the gate on the `mod` declaration — pick one).
  2. Collapse the else-if in `main.rs`.

Trivial, no behavior change — good first cleanup PR so toolchains matching CI don't keep reporting drift.

Repro

```bash
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --features tree-sitter -- -D warnings
```

Activity

  1. ajianaz commented on Aug 27, 2026

    @ajianaz
    CollaboratorAuthor

    Verified on develop after #528–#531 landed (4182466):

    cargo clippy --all-targets --features tree-sitter -- -D warnings
    

    → clean on rustc/cargo 1.97.1 — neither finding reproduces on the current toolchain.

    The reported code pattern still exists though (src/index/ast.rs carries the inner #![cfg(feature = "tree-sitter")] while the mod ast; declaration in src/index/mod.rs is already cfg-gated), so leaving this open as a minor cleanup: removing the inner attribute would make older clippy versions happy too.

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