·rust-error-advanced
</>

rust-error-advanced

huiali/rust-skills

深入错误处理专家。处理结果与选项、这个错误、无论如何、错误上下文、库与应用程序错误、错误处理、结果最有效、什么时候用恐慌

4安装·0热度·@huiali

安装

$npx skills add https://github.com/huiali/rust-skills --skill rust-error-advanced

SKILL.md

| Result | 预期会失败的操作 | 文件读取、网络请求 | | Option | absence 正常 | 查找、可能为空的值 | | panic! | bug 或不变式违规 | 程序逻辑错误、不可恢复错误 | | unreachable!() | 理论上不会执行到的代码 | 匹配穷举 |

| 库代码 | thiserror,精确的错误类型 | | 应用代码 | anyhow,易于传播和添加上下文 | | 库依赖库 | 传递第三方错误(#[from]) | | 需要错误码 | 枚举变体 | | 需要错误链 | context() + withcontext() |

| 处处 unwrap() | 库中 panic | 用 ? | | Box | 丢失类型信息 | thiserror 变体 | | 丢失上下文 | 调试困难 | .context() | | 错误变体过多 | 过度设计 | 简化或合并 |

深入错误处理专家。处理结果与选项、这个错误、无论如何、错误上下文、库与应用程序错误、错误处理、结果最有效、什么时候用恐慌 来源:huiali/rust-skills。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/huiali/rust-skills --skill rust-error-advanced
分类
</>开发工具
认证
收录时间
2026-02-01
更新时间
2026-02-18

快速解答

什么是 rust-error-advanced?

深入错误处理专家。处理结果与选项、这个错误、无论如何、错误上下文、库与应用程序错误、错误处理、结果最有效、什么时候用恐慌 来源:huiali/rust-skills。

如何安装 rust-error-advanced?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/huiali/rust-skills --skill rust-error-advanced 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

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

详情

分类
</>开发工具
来源
skills.sh
收录时间
2026-02-01