RS.CLIPPY.REDUNDANT_COMPARISONS

Double comparisons where one of them can be removed

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

What it does

Checks for ineffective double comparisons against constants.

Why is this bad?

Only one of the comparisons has any effect on the result, the programmer probably intended to flip one of the comparison operators, or compare a different value entirely.

Example

if status_code <= 400 && status_code < 500 {}