Rust Best-Practices Skill
Idiomatic refactors and clippy-clean code - an Agent Skill for Rust 1.97.0 (edition 2024) code review and cleanup.
Search across all documentation pages
Idiomatic refactors and clippy-clean code - an Agent Skill for Rust 1.97.0 (edition 2024) code review and cleanup.
Reviews PRs for idiomatic Rust: unnecessary clone, verbose match, missing impl Trait, poor visibility, stringly types, and clippy warnings. Produces small focused refactors with passing tests.
| Input | Why |
|---|---|
| Diff or module path | Scope limit |
| Clippy policy | -D warnings or allowlist |
| MSRV | edition 2024 features gated |
| Performance sensitivity | avoid hot-path churn |
cargo fmt and clippy clean verification#[must_use] and doc additions on public API#[allow] requires comment.cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-features
cargo doc --no-deps// Before
fn get_name(user: &User) -> String {
user.name.clone()
}
// After
fn get_name(user: &User) -> &str {
&user.name
}Team policy decides; default to default lint level plus agreed pedantic subset.
When ownership transfer is required and profiler shows cold path.
Follow workspace edition in Cargo.toml; skill respects manifest, not assumptions.
Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.
Reviewed by Chris St. John·Last updated Jul 16, 2026