Rust conventions
- Edition 2024, MSRV 1.95. Don't use APIs newer than the MSRV.
- Errors:
anyhow::Resultfor application/CLI paths (add.context(...));thiserrorenums for library error types (src/errors.rs). - No panics in library code: no
unwrap/expect/panic!/todo!on reachable paths — returnResult. Tests mayunwrap. - Logging:
tracingspans/events, notprintln!. Verbosity viaclap-verbosity-flag. - Parallelism:
rayoniterators for data-parallel work. - Newtypes: use
nutypewhere a wrapper adds real invariants/safety; don't wrap for its own sake. - Lints: keep clippy clean. CI runs
cargo clippy --workspace --all-features(no-D warningshere, but fix warnings anyway). Runcargo fmtbefore finishing. - Prefer crates already in the tree (itertools, indexmap, rustc-hash, strum, enumflags2) over hand-rolling.