2017-02-07 14:05:30 -06:00
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:40:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / if x {
|
|
|
|
LL | | true
|
|
|
|
LL | | } else {
|
|
|
|
LL | | false
|
|
|
|
LL | | };
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^ help: you can reduce it to: `x`
|
2019-08-05 15:05:05 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-bool` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::needless_bool)]`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:45:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / if x {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^ help: you can reduce it to: `!x`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:50:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / if x && y {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^ help: you can reduce it to: `!(x && y)`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2019-08-05 15:05:05 -05:00
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:58:5
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
|
LL | / if a == b {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `a != b`
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:63:5
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
|
LL | / if a != b {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `a == b`
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:68:5
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
|
LL | / if a < b {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `a >= b`
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:73:5
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
|
LL | / if a <= b {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `a > b`
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:78:5
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
|
LL | / if a > b {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `a <= b`
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:83:5
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
|
LL | / if a >= b {
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `a < b`
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:111:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / if x {
|
|
|
|
LL | | return true;
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return false;
|
|
|
|
LL | | };
|
2019-08-05 15:05:05 -05:00
|
|
|
| |_____^ help: you can reduce it to: `return x`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:119:5
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | / if x {
|
|
|
|
LL | | return false;
|
2019-08-05 15:05:05 -05:00
|
|
|
LL | | } else {
|
|
|
|
LL | | return true;
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | };
|
2019-08-05 15:05:05 -05:00
|
|
|
| |_____^ help: you can reduce it to: `return !x`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:127:5
|
2018-12-27 09:57:55 -06: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 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:135:5
|
2018-12-27 09:57:55 -06: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 14:05:30 -06:00
|
|
|
|
2018-10-28 09:37:39 -05:00
|
|
|
error: equality checks against true are unnecessary
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:143:8
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | if x == true {};
|
|
|
|
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::bool-comparison` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::bool_comparison)]`
|
2018-10-28 09:37:39 -05:00
|
|
|
|
|
|
|
error: equality checks against false can be replaced by a negation
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:147:8
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | if x == false {};
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
|
2018-10-28 09:37:39 -05:00
|
|
|
|
|
|
|
error: equality checks against true are unnecessary
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:157:8
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | if x == true {};
|
|
|
|
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
2018-10-28 09:37:39 -05:00
|
|
|
|
|
|
|
error: equality checks against false can be replaced by a negation
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:158:8
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | if x == false {};
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
|
2018-10-28 09:37:39 -05:00
|
|
|
|
2019-01-20 09:15:00 -06:00
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:167:12
|
2019-01-20 09:15:00 -06:00
|
|
|
|
|
|
|
|
LL | } else if returns_bool() {
|
|
|
|
| ____________^
|
|
|
|
LL | | false
|
|
|
|
LL | | } else {
|
|
|
|
LL | | true
|
|
|
|
LL | | };
|
2019-08-04 15:08:28 -05:00
|
|
|
| |_____^ help: you can reduce it to: `{ !returns_bool() }`
|
2019-01-20 09:15:00 -06:00
|
|
|
|
2021-12-17 06:40:22 -06:00
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:180:5
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | / if unsafe { no(4) } & 1 != 0 {
|
|
|
|
LL | | true
|
|
|
|
LL | | } else {
|
|
|
|
LL | | false
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:185:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _brackets_unneeded = if unsafe { no(4) } & 1 != 0 { true } else { false };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `unsafe { no(4) } & 1 != 0`
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/fixable.rs:188:9
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | if unsafe { no(4) } & 1 != 0 { true } else { false }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
|
|
|
|
|
2021-12-30 08:10:43 -06:00
|
|
|
error: aborting due to 21 previous errors
|
2018-01-16 10:06:27 -06:00
|
|
|
|