Summary
manual_ignore_case_cmp doesn't detect code that walks an iterator of .chars(). See the reproducer.
Lint Name
manual_ignore_case_cmp
Reproducer
Example 1:
let file_name = OsString::from("XYz");
let ret = file_name.to_str().is_some_and(|dir| {
dir.chars()
.map(|c| c.to_ascii_lowercase())
.cmp(".xyz".chars().map(|c| c.to_ascii_lowercase()))
.is_eq()
});
Example 2:
let file_name = String::from("XYz");
let ret = file_name
.chars()
.map(|c| c.to_ascii_lowercase())
.cmp(".xyz".chars().map(|c| c.to_ascii_lowercase()))
.is_eq();
I would like to see this caught by manual_ignore_case_cmp, and turned into the following:
let file_name = OsString::from("XYz");
let ret = file_name.eq_ignore_ascii_case(".xyz");
Version
rustc 1.95.0 (59807616e 2026-04-14)
binary: rustc
commit-hash: 59807616e1fa2540724bfbac14d7976d7e4a3860
commit-date: 2026-04-14
host: x86_64-unknown-linux-gnu
release: 1.95.0
LLVM version: 22.1.2
Summary
manual_ignore_case_cmpdoesn't detect code that walks an iterator of.chars(). See the reproducer.Lint Name
manual_ignore_case_cmp
Reproducer
Example 1:
Example 2:
I would like to see this caught by
manual_ignore_case_cmp, and turned into the following:Version