]> git.lizzy.rs Git - rust.git/blob - src/docs/match_str_case_mismatch.txt
[Arithmetic] Consider literals
[rust.git] / src / docs / match_str_case_mismatch.txt
1 ### What it does
2 Checks for `match` expressions modifying the case of a string with non-compliant arms
3
4 ### Why is this bad?
5 The arm is unreachable, which is likely a mistake
6
7 ### Example
8 ```
9 match &*text.to_ascii_lowercase() {
10     "foo" => {},
11     "Bar" => {},
12     _ => {},
13 }
14 ```
15 Use instead:
16 ```
17 match &*text.to_ascii_lowercase() {
18     "foo" => {},
19     "bar" => {},
20     _ => {},
21 }
22 ```