Closed
Description
Description
I believe the lint should be triggered in this case:
let s = String::from("test");
if s.eq("") {
println!("empty string");
} else {
println!("not empty string");
}
I have the same in the case of Vec
used:
let s = vec![1, 2, 3];
if s.eq(&[]) {
println!("empty vec");
} else {
println!("not empty vec");
}
Version
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-pc-windows-msvc
release: 1.81.0
LLVM version: 18.1.7
Additional Labels
No response