- Build:
cargo build - Lint:
cargo clippy --all-targets --all-features -- -D warnings - Format:
cargo fmt --all - Test (all):
cargo test - Test (single):
cargo test <testname>
- Imports: Group std, external, and internal modules separately. Use explicit imports.
- Formatting: Use
cargo fmt(default Rust style). - Types: Prefer explicit types for public APIs. Use
anyhow::Resultfor error handling. - Naming: Use
snake_casefor functions/variables,CamelCasefor types/traits,SCREAMING_SNAKE_CASEfor constants. - Error Handling: Use
anyhow::Resultand?for propagation. Add context with.context()where helpful. - Modules: Organize code into modules in
src/. Re-export public APIs inlib.rs. - Testing: Add tests in
#[cfg(test)]modules within each file. Usecargo testto run.
No Cursor or Copilot rules are present. Follow idiomatic Rust and these guidelines for consistency.