What problem does it solve?
Helps you consistently write and review Rust code with strong idioms, reliable error handling, and performance-aware practices instead of ad-hoc patterns.
Core Features & Use Cases
- Ownership and borrowing guidance: Chooses references vs cloning, prefers efficient parameter types (like
&str/&[T]), and recommends Cow when ownership is ambiguous.
- Production-safe error handling: Encourages
Result over panic!, bans unwrap/expect outside tests, and recommends thiserror for libraries and anyhow for binaries.
- Performance mindset and lint discipline: Promotes
--release benchmarking, targeted cargo clippy runs, and specific lint awareness (e.g., redundant_clone, needless_collect).
- Maintainable code and testing practices: Recommends descriptive test naming, doc tests, and snapshot testing where appropriate, supported by documentation and comment standards.
Quick Start
Ask your AI to review the Rust module for ownership, error handling, clippy/lint risks, and performance pitfalls using this best-practices checklist.