@setoelkahfi / sigit / commits / d511bb4

Fix Windows clippy: silence dead_code for Unix-only backend/provider

The interactive client (run_interactive in main.rs, mod tui in chat.rs) is #[cfg(unix)]. On Windows the binary runs ACP-only and drives onde directly, so the entire `backend` module and the provider-resolution path in `provider` are legitimately unused there. With `-D warnings` clippy turned 26 dead_code/unused_import warnings into errors on windows-msvc only. Gate the suppression to non-Unix targets so macOS and Linux builds keep full lint coverage: - backend.rs, provider.rs: module-level #![cfg_attr(not(unix), allow(dead_code))] - main.rs: #[cfg_attr(not(unix), allow(unused_imports))] on the backend import Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0114ejs5iB6iEjQkSrzLavne

Claude committed Jun 22, 2026 at 22:12 UTC d511bb4a46946edc8051324ba833d128af0912c3
3 files changed +17
src/backend.rs
+7
index 9604cc9..0692e6d 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -10,6 +10,13 @@ //! //! The trait exposes neither `onde` nor OpenAI types, so the loop does not depend //! on a specific backend. +//! +//! The whole backend seam is wired up only through the interactive client, which +//! is `#[cfg(unix)]` (see `run_interactive` in `main.rs` and `mod tui` in +//! `chat.rs`). On non-Unix targets the binary runs ACP-only and drives `onde` +//! directly, so every item here is legitimately unused there. Suppress the +//! dead-code lint on those targets only — Unix builds still get full coverage. +#![cfg_attr(not(unix), allow(dead_code))] use std::sync::Arc;
src/main.rs
+3
index 5eb3529..36fd4a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,6 +58,9 @@ use agent_client_protocol::schema::{ use agent_client_protocol::{Agent, ByteStreams, Client, ConnectionTo, Responder}; use onde::inference::{ChatEngine, GgufModelConfig, ToolDefinition, ToolResult}; +// These back the interactive client (`run_interactive`), which is `#[cfg(unix)]`; +// the import is unused on non-Unix targets that run ACP-only. +#[cfg_attr(not(unix), allow(unused_imports))] use crate::backend::{InferenceBackend, LocalBackend, OpenAiBackend}; use std::path::PathBuf; use std::sync::atomic::{AtomicBool, Ordering};
src/provider.rs
+7
index 37d37d7..042f02b 100644 --- a/src/provider.rs +++ b/src/provider.rs @@ -7,6 +7,13 @@ //! 2. siGit Code Cloud: used when the user is logged in (`sigit login`). The //! endpoint and tier are built in, and the session token is the credential. //! 3. On-device: no login and no override, so inference runs locally. +//! +//! Provider resolution is consumed only by the interactive client, which is +//! `#[cfg(unix)]`. The display helpers (`cloud_tier_label`, `CLOUD_TIERS`) are +//! still used cross-platform by `/models`, but the resolution path is dead on +//! non-Unix targets, where the binary runs ACP-only and on-device. Suppress the +//! dead-code lint there only — Unix builds keep full coverage. +#![cfg_attr(not(unix), allow(dead_code))] use std::path::PathBuf;