Closed
Description
Hello,
During the review process of my recent PR there's been an idea to create a new lint for suggesting the usage of XOR when comparing bools, like so:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b5bbd3c8e28e981aa80e02a372f242e9
I'd like to work on it, but before I start let me get your opinion. Is it worth implementing? Are the other similar "optimizations" that can be included in such a lint come to your mind?
Any ideas are appreciated.
Original comment:
Wait, these are bools. So we could use a XOR here
if lhs_negative ^ rhs_negative;
Originally posted by @flip1995 in https://github.com/_render_node/MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMjIwMTAzMDk5OnYy/pull_request_review_threads/discussion
Alternative link: #4867 (comment)