mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
65 lines
1.5 KiB
Text
65 lines
1.5 KiB
Text
error: this `if` branch is empty
|
|
--> $DIR/needless_if.rs:26:5
|
|
|
|
|
LL | if (true) {}
|
|
| ^^^^^^^^^^^^ help: you can remove it
|
|
|
|
|
= note: `-D clippy::needless-if` implied by `-D warnings`
|
|
|
|
error: this `if` branch is empty
|
|
--> $DIR/needless_if.rs:28:5
|
|
|
|
|
LL | if maybe_side_effect() {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`
|
|
|
|
error: this `if` branch is empty
|
|
--> $DIR/needless_if.rs:33:5
|
|
|
|
|
LL | / if {
|
|
LL | | return;
|
|
LL | | } {}
|
|
| |________^
|
|
|
|
|
help: you can remove it
|
|
|
|
|
LL ~ ({
|
|
LL + return;
|
|
LL + });
|
|
|
|
|
|
|
error: this `if` branch is empty
|
|
--> $DIR/needless_if.rs:45:5
|
|
|
|
|
LL | / if {
|
|
LL | | if let true = true && true { true } else { false }
|
|
LL | | } && true
|
|
LL | | {}
|
|
| |______^
|
|
|
|
|
help: you can remove it
|
|
|
|
|
LL ~ ({
|
|
LL + if let true = true && true { true } else { false }
|
|
LL + } && true);
|
|
|
|
|
|
|
error: this `if` branch is empty
|
|
--> $DIR/needless_if.rs:83:5
|
|
|
|
|
LL | if { maybe_side_effect() } {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`
|
|
|
|
error: this `if` branch is empty
|
|
--> $DIR/needless_if.rs:85:5
|
|
|
|
|
LL | if { maybe_side_effect() } && true {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() } && true);`
|
|
|
|
error: this `if` branch is empty
|
|
--> $DIR/needless_if.rs:89:5
|
|
|
|
|
LL | if true {}
|
|
| ^^^^^^^^^^ help: you can remove it: `true;`
|
|
|
|
error: aborting due to 7 previous errors
|
|
|