m15-anti-pattern

Installation
Summary

Identify and resolve common Rust code anti-patterns during review.

  • Covers eight major anti-patterns with explanations and idiomatic alternatives, including excessive cloning, unwrap in production, and fighting the borrow checker
  • Provides a thinking framework to distinguish symptoms from root causes and trace issues to underlying design problems
  • Includes quick reference tables for beginner mistakes, code smells, common error patterns, and deprecated approaches with fixes
  • Links anti-patterns to related skills (ownership, error handling, performance) for deeper understanding
SKILL.md

Anti-Patterns

Layer 2: Design Choices

Core Question

Is this pattern hiding a design problem?

When reviewing code:

  • Is this solving the symptom or the cause?
  • Is there a more idiomatic approach?
  • Does this fight or flow with Rust?

Anti-Pattern → Better Pattern

Anti-Pattern Why Bad Better
Related skills

More from zhanghandong/rust-skills

Installs
5.4K
GitHub Stars
1.1K
First Seen
Jan 20, 2026