rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

New lint `const_is_empty`

Open samueltardieu opened this issue 4 months ago • 7 comments

This lint detects calls to .is_empty() on an entity initialized from a string literal and flag them as suspicious. To avoid triggering on macros called from generated code, it checks that the .is_empty() receiver, the call itself and the initialization come from the same context.

Fixes #12307

changelog: [const_is_empty]: new lint

samueltardieu avatar Feb 18 '24 15:02 samueltardieu