Repository navigation
fix: gate WhatsApp helpers used only by the Web adapter - #162
Conversation
Avoids dead-code warnings when whatsapp-web is off. Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): fix: gate WhatsApp helpers used only by the Web adapter. This pull request silences new `rustc 1.99.1` dead-code warnings for WhatsApp helpers that are only used when the `whatsapp-web` feature is on or under test. `WaFailure::bad_format` and `window::ClearOnDrop` (struct and its `Drop` impl) are now gated on `any(test, feature = "whatsapp-web")`, while the `WaFailure::BadFormat` variant — still matched by the Cloud adapter — carries a `cfg_attr(not(any(test, feature = "whatsapp-web")), allow(dead_code))` attribute and an explanatory doc comment. The latest-push delta could not be established, so no push-level comparison is reported. Review snapshot
Completeness: Complete What changedConditional-compilation and lint-attribute changes only, in two files. `WaFailure::bad_format` and `ClearOnDrop` (the struct plus its `Drop` implementation) are restricted to `cfg(any(test, feature = "whatsapp-web"))` builds, and `WaFailure::BadFormat` gains a doc comment plus `#[cfg_attr(not(any(test, feature = "whatsapp-web")), allow(dead_code))]` so the variant stays defined for the Cloud adapter's match arm without warning when the Web adapter is absent. No runtime path, branch, or input handling is altered. Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Under rustc 1.99.1 a build without
whatsapp-webwarned:WaFailure::BadFormatnever constructed,bad_formatnever used,ClearOnDropnever constructed. They are only used by the Web adapter (and tests), sobad_formatandClearOnDropare now gated onany(test, feature = "whatsapp-web"); the variant, still matched by the Cloud adapter, carries a matchingcfg_attr(allow(dead_code)).Verified with
cargo +1.99.1 clippy -D warnings(lib and all-targets) for no-default-features, email-send, whatsapp-web, email+lark+relay-websocket, workspace default and --all-features; nextest passes in all-features and no-default-features. The regression guard is the lint itself (a compile-time warning); no behaviour changes, so no new runtime test.Co-authored-by: Medulla medulla@tinyhumans.ai
Summary by CodeRabbit