11error: this if-then-else expression will always return true
2- --> $DIR/needless_bool.rs:31 :5
2+ --> $DIR/needless_bool.rs:32 :5
33 |
44LL | / if x {
55LL | | true
@@ -11,7 +11,7 @@ LL | | };
1111 = note: `-D clippy::needless-bool` implied by `-D warnings`
1212
1313error: this if-then-else expression will always return false
14- --> $DIR/needless_bool.rs:36 :5
14+ --> $DIR/needless_bool.rs:37 :5
1515 |
1616LL | / if x {
1717LL | | false
@@ -21,7 +21,7 @@ LL | | };
2121 | |_____^
2222
2323error: this if-then-else expression returns a bool literal
24- --> $DIR/needless_bool.rs:41 :5
24+ --> $DIR/needless_bool.rs:42 :5
2525 |
2626LL | / if x {
2727LL | | true
@@ -31,7 +31,7 @@ LL | | };
3131 | |_____^ help: you can reduce it to: `x`
3232
3333error: this if-then-else expression returns a bool literal
34- --> $DIR/needless_bool.rs:46 :5
34+ --> $DIR/needless_bool.rs:47 :5
3535 |
3636LL | / if x {
3737LL | | false
@@ -41,7 +41,7 @@ LL | | };
4141 | |_____^ help: you can reduce it to: `!x`
4242
4343error: this if-then-else expression returns a bool literal
44- --> $DIR/needless_bool.rs:51 :5
44+ --> $DIR/needless_bool.rs:52 :5
4545 |
4646LL | / if x && y {
4747LL | | false
@@ -51,7 +51,7 @@ LL | | };
5151 | |_____^ help: you can reduce it to: `!(x && y)`
5252
5353error: this if-then-else expression will always return true
54- --> $DIR/needless_bool.rs:74 :5
54+ --> $DIR/needless_bool.rs:75 :5
5555 |
5656LL | / if x {
5757LL | | return true;
@@ -61,7 +61,7 @@ LL | | };
6161 | |_____^
6262
6363error: this if-then-else expression will always return false
64- --> $DIR/needless_bool.rs:83 :5
64+ --> $DIR/needless_bool.rs:84 :5
6565 |
6666LL | / if x {
6767LL | | return false;
@@ -71,7 +71,7 @@ LL | | };
7171 | |_____^
7272
7373error: this if-then-else expression returns a bool literal
74- --> $DIR/needless_bool.rs:92 :5
74+ --> $DIR/needless_bool.rs:93 :5
7575 |
7676LL | / if x {
7777LL | | return true;
@@ -81,7 +81,7 @@ LL | | };
8181 | |_____^ help: you can reduce it to: `return x`
8282
8383error: this if-then-else expression returns a bool literal
84- --> $DIR/needless_bool.rs:101 :5
84+ --> $DIR/needless_bool.rs:102 :5
8585 |
8686LL | / if x && y {
8787LL | | return true;
@@ -91,7 +91,7 @@ LL | | };
9191 | |_____^ help: you can reduce it to: `return x && y`
9292
9393error: this if-then-else expression returns a bool literal
94- --> $DIR/needless_bool.rs:110 :5
94+ --> $DIR/needless_bool.rs:111 :5
9595 |
9696LL | / if x {
9797LL | | return false;
@@ -101,7 +101,7 @@ LL | | };
101101 | |_____^ help: you can reduce it to: `return !x`
102102
103103error: this if-then-else expression returns a bool literal
104- --> $DIR/needless_bool.rs:119 :5
104+ --> $DIR/needless_bool.rs:120 :5
105105 |
106106LL | / if x && y {
107107LL | | return false;
@@ -111,41 +111,41 @@ LL | | };
111111 | |_____^ help: you can reduce it to: `return !(x && y)`
112112
113113error: equality checks against true are unnecessary
114- --> $DIR/needless_bool.rs:127 :8
114+ --> $DIR/needless_bool.rs:128 :8
115115 |
116116LL | if x == true {};
117117 | ^^^^^^^^^ help: try simplifying it as shown: `x`
118118 |
119119 = note: `-D clippy::bool-comparison` implied by `-D warnings`
120120
121121error: equality checks against false can be replaced by a negation
122- --> $DIR/needless_bool.rs:131 :8
122+ --> $DIR/needless_bool.rs:132 :8
123123 |
124124LL | if x == false {};
125125 | ^^^^^^^^^^ help: try simplifying it as shown: `!x`
126126
127127error: equality checks against true are unnecessary
128- --> $DIR/needless_bool.rs:141 :8
128+ --> $DIR/needless_bool.rs:142 :8
129129 |
130130LL | if x == true {};
131131 | ^^^^^^^^^ help: try simplifying it as shown: `x`
132132
133133error: equality checks against false can be replaced by a negation
134- --> $DIR/needless_bool.rs:142 :8
134+ --> $DIR/needless_bool.rs:143 :8
135135 |
136136LL | if x == false {};
137137 | ^^^^^^^^^^ help: try simplifying it as shown: `!x`
138138
139139error: this if-then-else expression returns a bool literal
140- --> $DIR/needless_bool.rs:151 :12
140+ --> $DIR/needless_bool.rs:152 :12
141141 |
142142LL | } else if returns_bool() {
143143 | ____________^
144144LL | | false
145145LL | | } else {
146146LL | | true
147147LL | | };
148- | |_____^ help: you can reduce it to: `!returns_bool()`
148+ | |_____^ help: you can reduce it to: `{ !returns_bool() } `
149149
150150error: aborting due to 16 previous errors
151151
0 commit comments