From fuse-rust
Use when writing or reviewing idiomatic Rust — edition 2024 features, ownership/borrowing design, and correcting the pitfalls that show up in LLM-generated Rust (clone tax, unwrap infestation, String vs &str, indexed loops, over-annotated lifetimes). Do NOT use for error-type design (use rust-error-handling), async runtimes, or SOLID/file-layout rules (use fuse-solid:solid-rust).
How this skill is triggered — by the user, by Claude, or both
Slash command
/fuse-rust:rust-core-languageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Idiomatic Rust for stable **1.96.1**, **edition 2024**. This skill covers what the
Idiomatic Rust for stable 1.96.1, edition 2024. This skill covers what the compiler will not catch for you: ownership design that avoids gratuitous cloning, and the recurring failure modes of machine-generated Rust.
edition in Cargo.toml
and its existing ownership conventions before adding code.cargo clippy.Never state a stabilization version from memory — verify against
doc.rust-lang.org/releases.html.
| Topic | When |
|---|---|
| Edition 2024 features | Setting up a crate, using let chains / async closures |
| Ownership & borrowing | Designing function signatures and data flow |
| LLM pitfalls | Reviewing or repairing generated Rust before merge |
&T / &str / &[T] in parameters unless the
function must keep the value. See ownership-borrowing.md..clone() needs a reason. A clone to silence a borrow-checker error is a
design smell (the "clone tax"). Redesign ownership first; clone only when a
second owner genuinely exists..unwrap() / .expect() on fallible values without a written justification.
Grep for them before merge. Prefer ?, match, or a documented invariant.Arc::clone(&x) over x.clone() for reference-counted handles — it makes the
cheap pointer-copy explicit and distinguishes it from a deep clone.iter()/map()/filter()/collect() to
for i in 0..len { v[i] } — no bounds-check noise, no off-by-one.if let A = x && let B = y && cond) stabilized in 1.88.0
(2025-06-26), edition 2024 only — depends on the if let temporary-scope change.async || { .. }) stabilized in 1.85.0.gen blocks are UNSTABLE — feature gate #![feature(gen_blocks)], tracking
issue rust-lang/rust#117078, RFC #3513. Do NOT use on stable; the returned
iterators are not yet fused and the syntax may still change.| Topic | Reference | Load when |
|---|---|---|
| Edition 2024 | edition-2024.md | Configuring edition, using let chains / async closures, checking feature stability |
| Ownership & borrowing | ownership-borrowing.md | Choosing owned vs borrowed params, designing lifetimes, sharing with Rc/Arc |
| LLM pitfalls | llm-pitfalls.md | Reviewing generated Rust for clone tax, unwrap infestation, String/&str, indexed loops |
| Template | Load when |
|---|---|
| idiomatic-code.md | Need copy-paste examples of borrow-first signatures, iterator chains, and let chains |
Cargo.toml declares edition = "2024" if edition-2024 features are used.clone() added purely to satisfy the borrow checker.unwrap()/.expect() has a justifying comment or is provably infalliblecargo clippy clean, sniper passednpx claudepluginhub fusengine/agents --plugin fuse-rustRust as a language — ownership and lifetimes, error hierarchies with thiserror/anyhow, async with Tokio, trait design, testing, performance, clippy, and rustdoc. Use when writing or reviewing Rust code, deciding between borrowing and cloning, designing an error type, structuring async tasks and channels, or configuring lints and benchmarks. Do not use for Axum HTTP routing and middleware (rc-axum), SQLx/Postgres data access (rc-sqlx), SvelteKit (rc-sveltekit), or non-Rust languages.
Idiomatic Rust development. Use when writing Rust code, Cargo crates/workspaces, Rust tests, or rustfmt/clippy/cargo workflows. Emphasizes ownership, Result errors, small APIs, stdlib-first dependencies, fast cargo feedback, and behavior tests. NOT for Go, Python, TypeScript, shell scripts, or infra-only work.
Reviews Rust code for ownership, borrowing, lifetimes, error handling, trait design, unsafe usage, and common mistakes. Covers Rust 2024 edition patterns and modern idioms.