Closed
Description
What it does
It suggests to replace a coding pattern of using range + "contains" with a more specific function.
Lint Name
is_ascii_digit_instead_contains
Category
style
Advantage
Less bug-prone, shorter
Drawbacks
No response
Example
fn foo1(d: u8) -> bool {
(b'0' ..= b'9').contains(&d)
}
Could be written as:
fn foo2(d: u8) -> bool {
d.is_ascii_digit()
}