RS.CLIPPY.INFALLIBLE_DESTRUCTURING_MATCH

A `match` statement with a single infallible arm instead of a `let`

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

What it does

Checks for matches being used to destructure a single-variant enum or tuple struct where a let will suffice.

Why is this bad?

Just readability – let doesn't nest, whereas a match does.

Example

enum Wrapper {
    Data(i32),
}

let wrapper = Wrapper::Data(42);

let data = match wrapper {
    Wrapper::Data(i) => i,
};

The correct use would be:

enum Wrapper {
    Data(i32),
}

let wrapper = Wrapper::Data(42);
let Wrapper::Data(data) = wrapper;