Parent: #108
Problem
The silent-error pattern let _ = some_result_returning_call(); is endemic across the workspace:
crates/app/src/network_bridge.rs — ~15+ sites
crates/relay/src/main.rs — read/write I/O errors swallowed
crates/client/src/mutations.rs — broadcast failures swallowed
crates/client/src/listeners.rs — send failures swallowed
Some of these are intentional (unbounded mpsc channels that only fail on shutdown). Many are not. Several of the bugs uncovered in the review trace back to this pattern. Code reviewers have trouble telling "intentional" from "oops" because the syntax is identical.
Fix
-
Enable the clippy::let_underscore_must_use lint at deny level workspace-wide:
# Cargo.toml workspace lints
[workspace.lints.clippy]
let_underscore_must_use = "deny"
-
For each existing violation, decide:
- Keep silent: add
drop(result) and a comment explaining why, or replace with .ok() on the Result.
- Log a warning: replace with
if let Err(e) = ... { warn!(...) }.
- Propagate: add
?.
-
Run just check to find the existing violation set and drive it to zero over one or two PRs.
Notes
- Consider also enabling
clippy::unused_result_ok (if available) which catches .ok(); at statement position.
- This is not the same as
#[must_use]. Many Willow functions already return Result; the lint catches accidental let _ = on those.
- Don't set this globally until existing violations are fixed. This issue's implementation is:
- Drive existing violations to zero in the critical-path crates first (relay, client, state, crypto).
- Then flip the lint.
Test
Running just check after the lint is enabled should pass. The CI workflow in .github/workflows/ should already run just check — verify.
Parent: #108
Problem
The silent-error pattern
let _ = some_result_returning_call();is endemic across the workspace:crates/app/src/network_bridge.rs— ~15+ sitescrates/relay/src/main.rs— read/write I/O errors swallowedcrates/client/src/mutations.rs— broadcast failures swallowedcrates/client/src/listeners.rs— send failures swallowedSome of these are intentional (unbounded mpsc channels that only fail on shutdown). Many are not. Several of the bugs uncovered in the review trace back to this pattern. Code reviewers have trouble telling "intentional" from "oops" because the syntax is identical.
Fix
Enable the
clippy::let_underscore_must_uselint atdenylevel workspace-wide:For each existing violation, decide:
drop(result)and a comment explaining why, or replace with.ok()on theResult.if let Err(e) = ... { warn!(...) }.?.Run
just checkto find the existing violation set and drive it to zero over one or two PRs.Notes
clippy::unused_result_ok(if available) which catches.ok();at statement position.#[must_use]. Many Willow functions already returnResult; the lint catches accidentallet _ =on those.Test
Running
just checkafter the lint is enabled should pass. The CI workflow in.github/workflows/should already runjust check— verify.