What problem does it solve?
This Skill helps you produce correct Rust code by guiding ownership, borrowing, lifetimes, error handling, and iteration patterns that satisfy the borrow checker and idiomatic expectations.
Core Features & Use Cases
- Ownership & Borrowing Guidance: Decide when to move values, borrow immutably, or borrow mutably to avoid design smells.
- Lifetimes Strategy: Add lifetimes only when needed, avoid unnecessary
'static complexity, and choose owned data or Arc when lifetimes proliferate.
- Idiomatic Error Handling: Use
Result with ?, choose thiserror for libraries or anyhow for applications, and attach context for debuggability.
- Traits & Dispatch Choices: Prefer capability-based trait design and select
impl Trait vs dyn Trait appropriately.
- Iterator-First Implementation: Use iterator chains instead of indexed loops, and choose
iter()/into_iter()/iter_mut() based on intent.
- Async Rust Guardrails: Select a runtime (typically
tokio), avoid blocking, and design for Send + 'static where required.
Quick Start
Use the language-rust skill to refactor your .rs code so it compiles cleanly and follows idiomatic ownership, borrowing, lifetimes, and Result-based error handling.