rust-best-practices

Installation
SKILL.md

Rust best practices

Use when writing or reviewing Rust crates, APIs, and application code (services, workers, CLIs).

Types and errors

  • Prefer Result over panics for recoverable failures; use thiserror (or similar) for structured error types in libraries and APIs.
  • Keep public error types stable and actionable; avoid leaking internal strings in production responses.
  • Use Option only for true absence; don’t overload it for error cases.

Ownership and API design

  • Take &str / &[T] for read-only borrowed input; use String / Vec when you need to own.
  • Prefer impl Trait or concrete generics in public APIs when it clarifies bounds; avoid overly clever type-level tricks without payoff.
  • Clone only where cheap or necessary; prefer Arc for shared immutable data across threads when profiling supports it.

Modules and visibility

Installs
1
First Seen
Apr 12, 2026
rust-best-practices — alexandretrotel/skills