rust-best-practices

Enforce safe, idiomatic Rust patterns for ownership, borrowing, and async Tokio code.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/eous/dotclaude --skill rust-best-practices-eous
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-best-practices
Source: https://github.com/eous/dotclaude/tree/main/skills/rust-best-practices
Command: npx skills add https://github.com/eous/dotclaude --skill rust-best-practices-eous

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust development patterns and practices to produce safer, more idiomatic Rust code and reliable libraries.

Core Features & Use Cases

  • Ownership and borrowing guidance to reduce unnecessary moves and improve performance.
  • Comprehensive error handling, trait usage, lifetimes, and async Rust patterns with practical examples.
  • Testing, performance considerations, and anti-patterns to avoid in production code.

Quick Start

Start by applying ownership and borrowing best practices to a Rust module and progressively integrate error handling and async patterns.

Frequently Asked Questions about rust-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Rust ownership and borrowing errors in my code?

Fix Rust ownership and borrowing errors by applying idiomatic patterns that reduce unnecessary moves. Restructuring data flow to minimize mutable borrows ensures safer, more efficient memory usage.

What are the best practices for async Rust with Tokio?

For async Rust with Tokio, best practices involve structuring concurrent tasks safely and managing resources effectively. Following idiomatic patterns prevents deadlocks and ensures reliable execution.

How do I handle errors and define lifetimes in Rust libraries?

Handle errors and define Rust lifetimes by using comprehensive error types and explicit trait boundaries. Practical examples enforce safe lifetime constraints to build robust, reliable library designs.

How do I write tests and avoid anti-patterns in Rust production code?

Write tests and avoid Rust anti-patterns by following structured testing guidance and performance considerations. Avoiding common production pitfalls ensures codebases remain maintainable and performant.

When should I use traits to optimize Rust performance?

Use traits to optimize Rust performance when you need flexible, idiomatic code structures. Concrete examples show how proper trait usage reduces unnecessary computations and improves execution speed.