mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-24 12:03:28 +00:00
75 lines
1.7 KiB
Text
75 lines
1.7 KiB
Text
error: this `if` branch is empty
|
|
--> tests/ui/needless_if.rs:27:5
|
|
|
|
|
LL | if (true) {}
|
|
| ^^^^^^^^^^^^ help: you can remove it
|
|
|
|
|
= note: `-D clippy::needless-if` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::needless_if)]`
|
|
|
|
error: this `if` branch is empty
|
|
--> tests/ui/needless_if.rs:29:5
|
|
|
|
|
LL | if maybe_side_effect() {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`
|
|
|
|
error: this `if` branch is empty
|
|
--> tests/ui/needless_if.rs:34:5
|
|
|
|
|
LL | / if {
|
|
LL | | return;
|
|
LL | | } {}
|
|
| |________^
|
|
|
|
|
help: you can remove it
|
|
|
|
|
LL ~ ({
|
|
LL + return;
|
|
LL + });
|
|
|
|
|
|
|
error: this `if` branch is empty
|
|
--> tests/ui/needless_if.rs:50:5
|
|
|
|
|
LL | / if {
|
|
LL | | if let true = true
|
|
LL | | && true
|
|
LL | | {
|
|
... |
|
|
LL | | } && true
|
|
LL | | {}
|
|
| |______^
|
|
|
|
|
help: you can remove it
|
|
|
|
|
LL ~ ({
|
|
LL + if let true = true
|
|
LL + && true
|
|
LL + {
|
|
LL + true
|
|
LL + } else {
|
|
LL + false
|
|
LL + }
|
|
LL + } && true);
|
|
|
|
|
|
|
error: this `if` branch is empty
|
|
--> tests/ui/needless_if.rs:94:5
|
|
|
|
|
LL | if { maybe_side_effect() } {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`
|
|
|
|
error: this `if` branch is empty
|
|
--> tests/ui/needless_if.rs:96:5
|
|
|
|
|
LL | if { maybe_side_effect() } && true {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() } && true);`
|
|
|
|
error: this `if` branch is empty
|
|
--> tests/ui/needless_if.rs:100:5
|
|
|
|
|
LL | if true {}
|
|
| ^^^^^^^^^^ help: you can remove it: `true;`
|
|
|
|
error: aborting due to 7 previous errors
|
|
|