RS.CLIPPY.MATCH_WILD_ERR_ARM

A `match` with `Err(_)` arm and take drastic actions

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: match_wild_err_arm. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for arm which matches all errors with Err(_) and take drastic actions like panic!.

Why is this bad?

It is generally a bad practice, similar to catching all exceptions in java with catch(Exception)

Example

let x: Result<i32, &str> = Ok(3);
match x {
    Ok(_) => println!("ok"),
    Err(_) => panic!("err"),
}