chore: reduce tokio features to rt+macros#37
Conversation
tokio is declared with features = ["full"] but the codebase is fully synchronous (fn main, std::thread::spawn, std::sync::mpsc). Zero uses of async/.await/tokio:: anywhere in src/. Reducing to ["rt", "macros"] eliminates unused modules (net, fs, io-util, signal, sync::broadcast) and their transitive dependencies, shrinking the attack surface. Build, clippy, and all tests pass.
Pre-existing clippy lint in codex.rs:454 - collapse `if` guard into the match arm pattern. Unrelated to the tokio feature change but needed for CI to pass on the upstream clippy 1.95 runner.
|
Thanks @tbouquet — nice catch and the analysis is spot-on. One suggestion before we merge: since Could you:
Also, the
|
|
@tbouquet One more thing — the change in |
Codebase is fully synchronous (no async/.await/tokio:: usage), so drop the crate entirely rather than keep unused features.
Keep this PR focused on the tokio change; the match-guard refactor will be reviewed separately.
Rust 1.95 stable added the collapsible_match lint that rejects the
nested 'if' inside this 'Some("user_message")' arm. Move the empty
check into a match guard to unbreak CI (same failure affects main).
Summary
"full"to["rt", "macros"]fn main,std::thread::spawn,std::sync::mpsc) with zero uses ofasync/.await/tokio::anywhere insrc/"full"pulls in unused modules (net, fs, io-util, signal, sync::broadcast) and ~9 transitive crates that only increase compile time and attack surfaceTest plan
cargo build --releasepassescargo clippy -- -D warningspassescargo test- all 25 tests passgrep -r "async\|tokio\|\.await" src/returns zero matchesAdditional note
A
cargo-auditCI job (rustsec/audit-check@v2) would also be valuable but requires theworkflowscope to modify.github/workflows/ci.yml. Happy to add it in a follow-up if you prefer, or you can add it directly: