cargo +nightly fmt- formatcargo clippy --all-features --all-targets- lint with featurescargo clippy --no-default-features --all-targets- lint withoutcargo t --all-features- test with all featurescargo t --no-default-features- test without features
Pre-commit: clippy (both feature sets) + fmt. Never use cargo check/build.
- Functional combinators over imperative control flow
let elsefor early returns, avoid nesting- No glob imports; group imports from same crate; no blank lines between imports
- Private by default,
pub(crate)for internal,pubfor API only; neverpub(super) thiserrorfor library errors, neveranyhoworeyrein library codetracingfor instrumentation: instrument work items not long-lived tasks;skip(self)on methods- Builders for structs with >4 fields or multiple same-type fields
- Tests: fail fast with
unwrap(), never returnResult; unit tests inmod tests - Rustdoc on all public items with usage examples; hide scaffolding with
# // SAFETY:comments on all unsafe blocks- Minimize generics in user-facing API; provide concrete types where possible
- Single library crate using the typestate pattern to enforce correct EVM usage at compile time
- State flow:
EvmNeedsCfg->EvmNeedsBlock->EvmNeedsTx->EvmReady->EvmTransacted - Extensive feature flags: test with both
--all-featuresand--no-default-features - Key features:
call,concurrent-db,estimate_gas,tracing-inspectors,alloy-db,test-utils - Uses
#[cfg_attr(docsrs, doc(cfg(...)))]for feature-gated documentation