RS.CLIPPY.BOOL_COMPARISON
Comparing a variable to a boolean, e.g., `if x == true` or `if x != true`
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: bool_comparison. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for expressions of the form x == true,
x != true and order comparisons such as x < true (or vice versa) and
suggest using the variable directly.
Why is this bad?
Unnecessary code.
Example
if x == true {}
if y == false {}
use x directly:
if x {}
if !y {}