Rust

Rust

Made by DeepSource

Found character comparison using .chars().next() RS-W1042

Anti-pattern
Minor
Autofix

To check if a str ends with a given character, use starts_with instead of _.chars().next() == Some(c).

Bad practice

"abc".chars().next() == Some('c');

Recommended

"abc".starts_with('c')