Closed
Description
Example: Any kind of xor
-like handling, e.g. let Foo
be one variant of an enum:
match (x, y) {
(Foo(_), Foo(_)) => None,
(Foo(x), _) |
(_, Foo(x)) => Some(x),
_ => None
}
This will trigger the lint, because the position of the arms is not taken into account.
@regexident suggested to only lint adjacent same arms. Another option would be to check if those arms are disjunct and can be reordered without changing semantics, but that is obviously much much harder to do in the general case.