cargo +nightly fmt- formatcargo clippy -p init4-bin-base --all-features --all-targets- lint with featurescargo clippy -p init4-bin-base --no-default-features --all-targets- lint withoutcargo t -p init4-bin-base- test specific crate
Pre-push: clippy (both feature sets) + fmt. Never use cargo check/build.
These checks apply before any push — new commits, rebases, cherry-picks, etc.
- Functional combinators over imperative control flow
let elsefor early returns, avoid nesting- No glob imports; group imports from same crate
- Private by default,
pub(crate)for internal,pubfor API only thiserrorfor library errors,eyrefor apps, neveranyhow- Builders for structs with >4 fields or multiple same-type fields
- Tests: fail fast with
unwrap(), never returnResult
This crate re-exports many dependencies in its public API. Bumping a re-exported dependency's version is a breaking change if the new version is semver-incompatible. When bumping dependencies, ensure our own version bump signals the same level of compatibility.
Rules:
- If a re-exported dep gets a semver-incompatible bump, we MUST also bump our version incompatibly (i.e. bump minor while pre-1.0).
- If a re-exported dep gets a semver-compatible bump, our version bump need not signal incompatibility.
- Pre-1.0 crates treat minor bumps as breaking (e.g. 0.12 -> 0.13 is incompatible).
Via pub use in deps module:
tracing,tracing-core,tracing-subscriber,tracing-opentelemetryopentelemetry,opentelemetry-otlp,opentelemetry-sdkmetrics
Via public struct fields, function signatures, or trait impls:
alloy— struct fields, params, return types, trait implsreqwest— struct fields, function paramstokio— watch channels, JoinHandle in public APIoauth2— types in public APIaxum— Service/Layer trait implstower— Service/Layer trait implsurl— public struct fields