Closed
Description
Summary
Clippy doesn't catch that match arms are identical when using if
on Some
.
Lint Name
match_same_arms
Reproducer
I tried this code:
match Some(3) {
Some(v) if v == 3 => true,
Some(v) if v == 3 => true,
_ => false,
I expected to see this happen: Clippy would catch that the arms are identical.
Instead, this happened: Nothing. Clippy didn't catch on.
Version
rustc 1.71.0 (8ede3aae2 2023-07-12)
binary: rustc
commit-hash: 8ede3aae28fe6e4d52b38157d7bfe0d3bceef225
commit-date: 2023-07-12
host: x86_64-unknown-linux-gnu
release: 1.71.0
LLVM version: 16.0.5