RS.CLIPPY.IF_SAME_THEN_ELSE
`if` with the same `then` and `else` blocks
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: if_same_then_else. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for if/else with the same body as the then part
and the else part.
Why is this bad?
This is probably a copy & paste error.
Example
let foo = if ... {
42
} else {
42
};