·rust-anti-pattern
</>

rust-anti-pattern

huiali/rust-skills

Rust ist eine der Hauptursachen für Rust.代码异味, 常见错误, 代码审查, Refactor, 重构

4Installationen·0Trend·@huiali

Installation

$npx skills add https://github.com/huiali/rust-skills --skill rust-anti-pattern

SKILL.md

| 1 | 用 .clone() 躲避借用检查 | 使用引用 | | 2 | 生产代码用 .unwrap() | 用 ? 或 withcontext() | | 3 | 什么都是 String | 用 &str,必要时用 Cow | | 4 | 索引循环 | 用迭代器 .iter(), .enumerate() | | 5 | 与生命周期对抗 | 重新设计数据结构 |

| 很多 .clone() | 所有权不清晰 | 明确数据流 | | 很多 .unwrap() | 错误处理缺失 | 添加 Result 处理 | | 很多 pub 字段 | 封装被破坏 | 私有 + 访问器 | | 深度嵌套 | 逻辑复杂 | 提取方法 | | 函数过长 (>50行) | 职责过多 | 拆分职责 | | 巨大的枚举 | 缺少抽象 | Trait + 类型 |

| 索引循环 .items[i] | .iter().enumerate() | | collect:: >() 然后再遍历 | 链式迭代器 | | lazystatic! | std::sync::OnceLock | | mem::transmute 转换 | as 或 TryFrom | | 自定义链表 | Vec 或 VecDeque | | 手动 unsafe cell | Cell, RefCell |

Original anzeigen

Fakten (zitierbereit)

Stabile Felder und Befehle für KI/Such-Zitate.

Installationsbefehl
npx skills add https://github.com/huiali/rust-skills --skill rust-anti-pattern
Kategorie
</>Entwicklung
Verifiziert
Erstes Auftreten
2026-02-01
Aktualisiert
2026-02-18

Schnelle Antworten

Was ist rust-anti-pattern?

Rust ist eine der Hauptursachen für Rust.代码异味, 常见错误, 代码审查, Refactor, 重构 Quelle: huiali/rust-skills.

Wie installiere ich rust-anti-pattern?

Öffnen Sie Ihr Terminal oder Kommandozeilen-Tool (Terminal, iTerm, Windows Terminal, etc.) Kopieren Sie diesen Befehl und führen Sie ihn aus: npx skills add https://github.com/huiali/rust-skills --skill rust-anti-pattern Nach der Installation wird der Skill automatisch in Ihrer KI-Programmierumgebung konfiguriert und ist bereit zur Verwendung in Claude Code oder Cursor

Wo ist das Quell-Repository?

https://github.com/huiali/rust-skills