Rust Clinic

Idiomatic Rust review from a paste — verdict, findings, checklist, refined code.

Back to SkillSafe
Or pick files: .rs files are read locally, nothing uploads until you run.
Context — what the code does, what lives elsewhere
How it works

Nothing to hand? Load the — unwraps on reachable input, a blocking sleep on the executor, an unbounded channel and a lock held across an await — the , where it works but the types and clones are wrong, or the , which should come back sound.

1

Paste the Rust

One file, several files with // src/... comment headers, a module, or a grab-bag of snippets. The instant prescan reads it for free while you type and lists what it mechanically found: unwrap and expect outside test code, clones that only appease the borrow checker, Box<dyn Error> in a public API, wildcard match arms hiding future variants, unsafe blocks with no safety comment, blocking calls inside async fns, String parameters where a borrow would do, swallowed Results, unbounded channels, stringly-typed state, and panic! or todo! left in - plus the functions, structs, enums and traits declared and the impl block, unsafe block, async fn, test and line counts in your paste.

2

The AI reviews it

A sound/refactor/rework verdict; severity-ranked findings, each quoting the function, type or expression it concerns and carrying corrected Rust code; a twelve-item Rust checklist scored pass, fail or not-observable against your paste; and an honest health check across ownership and borrowing, error handling, type design and API surface, concurrency and async, and idioms and structure. Every prescan hit is confirmed or explicitly set aside — including the false positives, like an unwrap that lives inside a #[cfg(test)] block.

3

Take the rewrite and go

Your own code refined — same domain, same intent, same naming: errors propagated with ? and context instead of unwrapped, clones replaced with borrows, states modeled as enums, matches made exhaustive, blocking calls moved off the executor, unsafe given its safety contract or removed, visibility tightened — as a downloadable refined.rs, a unified diff against your own paste that git apply accepts, and a free re-run of the prescan over the rewrite so you can see which smells it actually cleared. Plus the ordered next steps, the findings as CSV, review history that follows your account across devices when you are signed in, a side-by-side compare of any two past reviews (fix, re-review, see what moved), and Markdown or JSON export you can load back in.

Derived from the @affaan-m/rust-patterns skill (MIT).