Rust-clippy: Suggest `x > y` over `x >= y + 1` for integers

Created on 13 Aug 2017  路  10Comments  路  Source: rust-lang/rust-clippy

Also all other combinations around comparison, and adding/subtracting 1 on either side.

A-style A-unnecessary L-lint T-middle good-first-issue hacktoberfest

Most helpful comment

This should also apply to changing a..b + 1 to a..=b.

All 10 comments

This should also apply to changing a..b + 1 to a..=b.

That's still unstable, but once it becomes stable, yes, that should be linted against

Now that it has been stabilized shall I have a go at implementing the second part of the lint?

jup!

yup?

The second part is all yours

shouldn't this be closed?

oh okay. Thought that you have tests for that in the pr.

Oh yea, we do have tests. I just screwed up on the playground. This works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenjaminGill-Metaswitch picture BenjaminGill-Metaswitch  路  22Comments

sanmai-NL picture sanmai-NL  路  23Comments

mikerite picture mikerite  路  17Comments

Manishearth picture Manishearth  路  26Comments

Manishearth picture Manishearth  路  18Comments