2017-02-07 20:05:30 +00:00
|
|
|
error: this if-then-else expression will always return true
|
2018-12-10 05:27:19 +00:00
|
|
|
--> $DIR/needless_bool.rs:40:5
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / if x {
|
|
|
|
LL | | true
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2018-12-10 05:27:19 +00:00
|
|
|
| |_____^
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-bool` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
2018-12-10 05:27:19 +00:00
|
|
|
--> $DIR/needless_bool.rs:45:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / if x {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | false
|
|
|
|
LL | | };
|
2018-12-10 05:27:19 +00:00
|
|
|
| |_____^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-12-10 05:27:19 +00:00
|
|
|
--> $DIR/needless_bool.rs:50:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / if x {
|
|
|
|
LL | | true
|
|
|
|
LL | | } else {
|
|
|
|
LL | | false
|
|
|
|
LL | | };
|
2018-12-10 05:27:19 +00:00
|
|
|
| |_____^ help: you can reduce it to: `x`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-12-10 05:27:19 +00:00
|
|
|
--> $DIR/needless_bool.rs:55:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / if x {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2018-12-10 05:27:19 +00:00
|
|
|
| |_____^ help: you can reduce it to: `!x`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-12-10 05:27:19 +00:00
|
|
|
--> $DIR/needless_bool.rs:60:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / if x && y {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2018-12-10 05:27:19 +00:00
|
|
|
| |_____^ help: you can reduce it to: `!(x && y)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression will always return true
|
2018-12-10 05:27:19 +00:00
|
|
|
--> $DIR/needless_bool.rs:83:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / if x {
|
|
|
|
LL | | return true;
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return true;
|
|
|
|
LL | | };
|
2018-12-10 05:27:19 +00:00
|
|
|
| |_____^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
2018-12-10 05:27:19 +00:00
|
|
|
--> $DIR/needless_bool.rs:92:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / if x {
|
|
|
|
LL | | return false;
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return false;
|
|
|
|
LL | | };
|
2018-12-10 05:27:19 +00:00
|
|
|
| |_____^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/needless_bool.rs:101:5
|
|
|
|
|
|
|
|
|
LL | / if x {
|
|
|
|
LL | | return true;
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return false;
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `return x`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/needless_bool.rs:110:5
|
|
|
|
|
|
|
|
|
LL | / if x && y {
|
|
|
|
LL | | return true;
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return false;
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `return x && y`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/needless_bool.rs:119:5
|
|
|
|
|
|
|
|
|
LL | / if x {
|
|
|
|
LL | | return false;
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return true;
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `return !x`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/needless_bool.rs:128:5
|
|
|
|
|
|
|
|
|
LL | / if x && y {
|
|
|
|
LL | | return false;
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return true;
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `return !(x && y)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
error: equality checks against true are unnecessary
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/needless_bool.rs:136:8
|
|
|
|
|
|
|
|
|
LL | if x == true {};
|
|
|
|
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::bool-comparison` implied by `-D warnings`
|
2018-10-28 14:37:39 +00:00
|
|
|
|
|
|
|
error: equality checks against false can be replaced by a negation
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/needless_bool.rs:140:8
|
|
|
|
|
|
|
|
|
LL | if x == false {};
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
|
2018-10-28 14:37:39 +00:00
|
|
|
|
|
|
|
error: equality checks against true are unnecessary
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/needless_bool.rs:150:8
|
|
|
|
|
|
|
|
|
LL | if x == true {};
|
|
|
|
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
2018-10-28 14:37:39 +00:00
|
|
|
|
|
|
|
error: equality checks against false can be replaced by a negation
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/needless_bool.rs:151:8
|
|
|
|
|
|
|
|
|
LL | if x == false {};
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
|
2018-10-28 14:37:39 +00:00
|
|
|
|
|
|
|
error: aborting due to 15 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|