Lint when >
or >=
is used i.e. compared values are not listed in (number line) order
#13082
Labels
A-lint
Area: New lints
What it does
Check that
<
and<=
are used rather than>
or>=
so that compared values are listed in order.Advantage
Drawbacks
PartialEq
impl for one direction is implemented, so it might need to be limited to cases where the operands implementEq
Example
Could be written as:
Preferably it would also recognize common operands so that
would become
i.e. for
&&
move common value to the operator and for||
move common value away from the operatorThe text was updated successfully, but these errors were encountered: