Closed
Description
If two arms have same values after inlining constants, clippy will report a lint on those arms. Is this a good idea? In my code I had two constants that were semantically different but happened to have the same value, and the suggested replacement did not really make sense.
Here's an example that triggers the lint:
const FOO: u32 = 4;
const BAR: u32 = 4;
fn main() {
match 1 {
1 => FOO,
2 => BAR,
_ => 0,
};
}
Metadata
Metadata
Assignees
Labels
No labels