Description
slightly amused:
#[derive(Eq, PartialEq)]
pub struct Data([u8; 4]);
const DATA: Data = Data([1, 2, 3, 4]);
fn main() {
match DATA {
DATA => (),
_ => (),
}
}
=>
7 | / match DATA {
8 | | DATA => (),
9 | | _ => (),
10 | | }
| |_____^ help: try: `if DATA == DATA { () }`
the suggested code however:
error: equal expressions as operands to `==`
--> a.rs:7:8
|
7 | if DATA == DATA { () }
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#eq_op
= note: `#[deny(clippy::eq_op)]` on by default
Version
rustc 1.81.0-nightly (9c3bc805d 2024-06-27)
binary: rustc
commit-hash: 9c3bc805dd9cb84019c124b9a50fdff1e62a7ec9
commit-date: 2024-06-27
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7
Additional Labels
No response
Description
slightly amused:
=>
the suggested code however:
Version
Additional Labels
No response