RS.CLIPPY.MATCH_STR_CASE_MISMATCH

Creation of a case altering match expression with non-compliant arms

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_str_case_mismatch. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for match expressions modifying the case of a string with non-compliant arms

Why is this bad?

The arm is unreachable, which is likely a mistake

Example

match &*text.to_ascii_lowercase() {
    "foo" => {},
    "Bar" => {},
    _ => {},
}

Use instead:

match &*text.to_ascii_lowercase() {
    "foo" => {},
    "bar" => {},
    _ => {},
}