Closed
Description
openedon Jun 20, 2023
What it does
This lint triggers on usage of legacy integral constants and functions, such as:
std::i32::MAX
u64::max_value()
Advantage
Enforce a consistent style across the ecosystem.
This lint should probably be placed into the clippy::style
group.
Drawbacks
Older projects will experience some churn, but this should be trivially auto-fixable in most cases.
T-libs-api opposes deprecating this outright so a clippy lint is the next best thing.
Example
if x == std::i32::MAX {
Could be written using the associated constant as:
if x == i32::MAX {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment