mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
c0939b18b8
[`identity_op`]: Fix duplicate diagnostics Relates to #12379 In the `identity_op` lint, the following diagnostic was emitted two times ``` --> tests/ui/identity_op.rs:156:5 | LL | 1 * 1; | ^^^^^ help: consider reducing it to: `1` | ``` because both of the left operand and the right operand are the identity element of the multiplication. This PR fixes the issue so that if a diagnostic is created for an operand, the check of the other operand will be skipped. It's fine because the result is always the same in the affected operators. --- changelog: [`identity_op`]: Fix duplicate diagnostics |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |