Claude Code conversion-method-naming skill for Rust ownership signals
Choose a Rust conversion name based on allocation cost, borrowed returns, and whether it consumes self.
中文Install in Claude Code
A Claude Code Rust project. Supply method signatures, return types, and ownership behavior.
- Review `.claude/skills/conversion-method-naming/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.claude/skills/conversion-method-naming/` in your project and save the reviewed file as `.claude/skills/conversion-method-naming/SKILL.md`.
- Start Claude Code from that project's root, then select `/conversion-method-naming` in the slash menu.
Example task
Invoke /conversion-method-naming and review this fictional route label type.
case `route-label-conversion-27`
type `RouteLabel`
method A cheap borrow of `&str` | method B allocates `String` and keeps self | method C consumes `self` and returns `String`What to check
Use `as_str` for the borrow, `to_string` for a new owned value, and `into_string` for consuming self. Explain the behavior callers should expect.
Original SKILL.md on GitHub · Updated
Frequently asked question
Can I use as for a new owned value?
Check whether it borrows, allocates, or consumes self. Choose to for allocating without consuming self.