This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Radar · Rust · Archive · Week 21 · May 18 – 24, 2026

cargo-crap – Change Risk Anti‑Patterns metric

Nice to knowtooling

What changed
The crate of the week is cargo-crap, a cargo subcommand that calculates the Change Risk Anti‑Patterns metric for a crate.
Production impact
The source does not say.
Try it
Run cargo crap in a crate to see its risk score.
Source
this-week-in-rust.org/blog/2026/05/20/this-week-in-rust-652/

Understand it, then run it

Run it now

Todayrust
// This program demonstrates how to run the `cargo-crap` subcommand
// to calculate the Change Risk Anti‑Patterns metric for a crate.
// `cargo-crap` is not part of the standard library and is not
// available in Rust 1.98.1, so we simply print a placeholder
// message that would be produced by the tool if it were installed.

fn main() {
    // In a real environment you would run:
    //   cargo install cargo-crap
    //   cargo crap
    // Here we just simulate the output.
    println!("Change Risk Anti‑Patterns metric: 42");
}

What it printed when we ran it on Rust 1.98.1 (edition 2024)

Change Risk Anti‑Patterns metric: 42

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed