mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 00:53:31 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
23 lines
350 B
Rust
23 lines
350 B
Rust
#![warn(clippy::unit_cmp)]
|
|
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
|
|
|
|
#[derive(PartialEq)]
|
|
pub struct ContainsUnit(()); // should be fine
|
|
|
|
fn main() {
|
|
// this is fine
|
|
if true == false {}
|
|
|
|
// this warns
|
|
if {
|
|
true;
|
|
} == {
|
|
false;
|
|
} {}
|
|
|
|
if {
|
|
true;
|
|
} > {
|
|
false;
|
|
} {}
|
|
}
|