Rust Idioms
Suggests idiomatic Rust code solutions based on provided context, improving readability and performance.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add rust-idioms npx -- -y @trustedskills/rust-idioms
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"rust-idioms": {
"command": "npx",
"args": [
"-y",
"@trustedskills/rust-idioms"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides suggestions for idiomatic Rust code solutions based on established best practices from the Rust Community. It leverages a comprehensive guide containing 44 rules across eight categories, prioritizing improvements to readability and performance. The skill aims to assist with refactoring existing code and generating new Rust code that adheres to community-accepted patterns.
When to use it
- When writing new Rust code requiring strong type guarantees.
- During refactoring of ownership and borrowing patterns.
- While designing error handling strategies.
- When creating public APIs using traits and generics.
- To organize modules and control visibility within a project.
Key capabilities
- Suggests solutions based on 44 Rust refactoring rules.
- Covers categories including Type Safety, Ownership & Borrowing, Error Handling, API Design, Module Organization, Conversion Traits, Idiomatic Patterns, and Iterator/Collection usage.
- Prioritizes suggestions by impact (Critical, High, Medium-High, Medium, Low-Medium).
- Provides guidance on specific patterns like newtype patterns,
Cow, the question mark operator (?), and trait derivation.
Example prompts
- "Suggest a more idiomatic way to handle this error."
- "How can I improve the ownership and borrowing in this code?"
- "What's the best practice for designing an API with traits?"
Tips & gotchas
- The skill’s suggestions are based on established community guidelines, but may not always be appropriate for every situation. Consider the context of your project when applying these recommendations.
- This skill focuses specifically on idiomatic Rust code; it is not a general-purpose coding assistant.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.