2017-02-07 20:05:30 +00:00
|
|
|
error: this if-then-else expression will always return true
|
2018-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:41:5
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
41 | if x { true } else { true };
|
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-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:42:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
42 | if x { false } else { false };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:43:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
43 | if x { true } else { false };
|
2017-07-21 08:40:23 +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-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:44:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
44 | if x { false } else { true };
|
2017-07-21 08:40:23 +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-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:45:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
45 | if x && y { false } else { true };
|
2017-07-21 08:40:23 +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-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:60:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
60 | if x { return true } else { return true };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
2018-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:65:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
65 | if x { return false } else { return false };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:70:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
70 | if x { return true } else { return false };
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:75:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
75 | if x && y { return true } else { return false };
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:80:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
80 | if x { return false } else { return true };
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-10-28 14:37:39 +00:00
|
|
|
--> $DIR/needless_bool.rs:85:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-10-28 14:37:39 +00:00
|
|
|
85 | if x && y { return false } else { return true };
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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
|
|
|
|
--> $DIR/needless_bool.rs:89:7
|
|
|
|
|
|
|
|
|
89 | if x == true { };
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `x`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::bool-comparison` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: equality checks against false can be replaced by a negation
|
|
|
|
--> $DIR/needless_bool.rs:93:7
|
|
|
|
|
|
|
|
|
93 | if x == false { };
|
|
|
|
| ^^^^^^^^^^^ help: try simplifying it as shown: `!x`
|
|
|
|
|
|
|
|
error: equality checks against true are unnecessary
|
|
|
|
--> $DIR/needless_bool.rs:104:8
|
|
|
|
|
|
|
|
|
104 | if x == true { };
|
|
|
|
| ^^^^^^^^^ help: try simplifying it as shown: `x`
|
|
|
|
|
|
|
|
error: equality checks against false can be replaced by a negation
|
|
|
|
--> $DIR/needless_bool.rs:105:8
|
|
|
|
|
|
|
|
|
105 | if x == false { };
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
|
|
|
|
|
|
|
|
error: aborting due to 15 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|