rust-best-practices
Installation
SKILL.md
Rust Best Practices
Based on Microsoft Pragmatic Rust Guidelines and Rust community standards.
Core Principles
- Leverage the type system — Use types to make invalid states unrepresentable
- Embrace ownership — Work with the borrow checker, not against it
- Explicit over implicit — Be clear about fallibility, mutability, and lifetimes
- Zero-cost abstractions — Use iterators, generics, and traits without runtime cost
- Fail fast, recover gracefully — Validate early, handle errors explicitly
Error Handling
Use thiserror for Libraries
use thiserror::Error;