Why is this an issue?

Case mismatches in pattern arms make some arms unreachable, likely leading to logic errors that can be difficult to debug.

Code examples

Noncompliant code example

match &*text.to_ascii_lowercase() {
    "foo" => {},
    "Bar" => {}, // Noncompliant: This arm is unreachable.
    _ => {},
}

Compliant solution

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

Resources

Documentation