Skip to content
Back to skills

Rust

ASecurity

Best practices for Rust development including ownership, error handling, and async patterns.

  • 57 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
developmentrustgoperformance

Works with

  • cli

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill rust --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rust?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rust
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-rust-awesome-omni-skill/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-rust-awesome-omni-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rust
description: Best practices for Rust development including ownership, error handling, and async patterns.
globs: ["**/*.rs", "**/Cargo.toml", "**/Cargo.lock"]
priority: 90
tags: ["language"]
---

# Rust Best Practices

## Ownership & Borrowing
- Prefer borrowing over ownership transfer
- Use &str for function parameters over String
- Clone only when necessary
- Use Cow<str> for maybe-owned strings

## Error Handling
- Use Result<T, E> for recoverable errors
- Use panic! only for unrecoverable errors
- Use ? operator for error propagation
- Create custom error types with thiserror
- Use anyhow for application errors

## Idioms
- Use iterators over manual loops
- Prefer pattern matching with match
- Use Option for optional values
- Use derive macros for common traits
- Use clippy for linting

## Performance
- Use release builds for benchmarks
- Profile before optimizing
- Consider using Box for large stack types
- Use Arc/Mutex for shared state

## Async
- Use tokio or async-std runtime
- Use async/await for async code
- Avoid blocking in async context
- Use channels for async communication

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.