Open svmnotn opened 8 years ago
Listed in #533
@svmnotn I think turning it off for a specific project is the right way to go. But I'd go even further in that case: write a (restriction) lint that forbids !var
for booleans. This way you can be sure that your code base doesn't contain the opposite.
I'd rather have exp == false
than !exp
, because !
is visually hard to see. The blog post https://eev.ee/blog/2016/12/01/lets-stop-copying-c/#_1 makes excellent point against that.
But even if the style guidelines end up supporting !
over == false
, I think that Clippy should lint if there is not whitespace around !
– that at least helps a bit visually.
I came here to add to the lamentations because it is my experience that very often Clippy recommends the !
on expressions like ident.is_cond_true()
which is directly against the flow of the overall reading, and in general negative reasoning is harder for me.
I think that the
bool_comparison
lint should not fire when the comparison isvar == false
because, at least I, find that version much easier to see when quickly scrolling through the code than the!var
as it is too simple to miss that single!
. However, I'm just putting this here for discussion I'll go turn the lint off in that specific place.Enjoy your rusty endeavors.