RS.CLIPPY.OVERLY_COMPLEX_BOOL_EXPR

Boolean expressions that contain terminals which can be eliminated

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: overly_complex_bool_expr. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for boolean expressions that contain terminals that can be eliminated.

Why is this bad?

This is most likely a logic bug.

Known problems

Ignores short circuiting behavior.

Example

// The `b` is unnecessary, the expression is equivalent to `if a`.
if a && b || a { ... }

Use instead:

if a {}

Past names

  • logic_bug