2017-02-07 21:05:30 +01:00
|
|
|
error: this if-then-else expression returns a bool literal
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:39:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / if x {
|
|
|
|
LL | | true
|
|
|
|
LL | | } else {
|
|
|
|
LL | | false
|
|
|
|
LL | | };
|
2018-12-10 06:27:19 +01:00
|
|
|
| |_____^ help: you can reduce it to: `x`
|
2019-08-05 22:05:05 +02:00
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-bool` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:44:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / if x {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2018-12-10 06:27:19 +01:00
|
|
|
| |_____^ help: you can reduce it to: `!x`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:49:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / if x && y {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2018-12-10 06:27:19 +01:00
|
|
|
| |_____^ help: you can reduce it to: `!(x && y)`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2019-08-05 22:05:05 +02:00
|
|
|
error: this if-then-else expression returns a bool literal
|
|
|
|
--> $DIR/fixable.rs:69:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / if x {
|
|
|
|
LL | | return true;
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return false;
|
|
|
|
LL | | };
|
2019-08-05 22:05:05 +02:00
|
|
|
| |_____^ help: you can reduce it to: `return x`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:77:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | / if x {
|
|
|
|
LL | | return false;
|
2019-08-05 22:05:05 +02:00
|
|
|
LL | | } else {
|
|
|
|
LL | | return true;
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | };
|
2019-08-05 22:05:05 +02:00
|
|
|
| |_____^ help: you can reduce it to: `return !x`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:85:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
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 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:93:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
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 21:05:30 +01:00
|
|
|
|
2018-10-28 15:37:39 +01:00
|
|
|
error: equality checks against true are unnecessary
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:101:8
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | if x == true {};
|
|
|
|
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::bool-comparison` implied by `-D warnings`
|
2018-10-28 15:37:39 +01:00
|
|
|
|
|
|
|
error: equality checks against false can be replaced by a negation
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:105:8
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | if x == false {};
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
|
2018-10-28 15:37:39 +01:00
|
|
|
|
|
|
|
error: equality checks against true are unnecessary
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:115:8
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | if x == true {};
|
|
|
|
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
2018-10-28 15:37:39 +01:00
|
|
|
|
|
|
|
error: equality checks against false can be replaced by a negation
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:116:8
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | if x == false {};
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
|
2018-10-28 15:37:39 +01:00
|
|
|
|
2019-01-20 16:15:00 +01:00
|
|
|
error: this if-then-else expression returns a bool literal
|
2019-08-05 22:05:05 +02:00
|
|
|
--> $DIR/fixable.rs:125:12
|
2019-01-20 16:15:00 +01:00
|
|
|
|
|
|
|
|
LL | } else if returns_bool() {
|
|
|
|
| ____________^
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2019-08-04 22:08:28 +02:00
|
|
|
| |_____^ help: you can reduce it to: `{ !returns_bool() }`
|
2019-01-20 16:15:00 +01:00
|
|
|
|
2019-08-05 22:05:05 +02:00
|
|
|
error: aborting due to 12 previous errors
|
2018-01-16 17:06:27 +01:00
|
|
|
|