1
1
error: this if-then-else expression will always return true
2
- --> $DIR/needless_bool.rs:31 :5
2
+ --> $DIR/needless_bool.rs:32 :5
3
3
|
4
4
LL | / if x {
5
5
LL | | true
@@ -11,7 +11,7 @@ LL | | };
11
11
= note: `-D clippy::needless-bool` implied by `-D warnings`
12
12
13
13
error: this if-then-else expression will always return false
14
- --> $DIR/needless_bool.rs:36 :5
14
+ --> $DIR/needless_bool.rs:37 :5
15
15
|
16
16
LL | / if x {
17
17
LL | | false
@@ -21,7 +21,7 @@ LL | | };
21
21
| |_____^
22
22
23
23
error: this if-then-else expression returns a bool literal
24
- --> $DIR/needless_bool.rs:41 :5
24
+ --> $DIR/needless_bool.rs:42 :5
25
25
|
26
26
LL | / if x {
27
27
LL | | true
@@ -31,7 +31,7 @@ LL | | };
31
31
| |_____^ help: you can reduce it to: `x`
32
32
33
33
error: this if-then-else expression returns a bool literal
34
- --> $DIR/needless_bool.rs:46 :5
34
+ --> $DIR/needless_bool.rs:47 :5
35
35
|
36
36
LL | / if x {
37
37
LL | | false
@@ -41,7 +41,7 @@ LL | | };
41
41
| |_____^ help: you can reduce it to: `!x`
42
42
43
43
error: this if-then-else expression returns a bool literal
44
- --> $DIR/needless_bool.rs:51 :5
44
+ --> $DIR/needless_bool.rs:52 :5
45
45
|
46
46
LL | / if x && y {
47
47
LL | | false
@@ -51,7 +51,7 @@ LL | | };
51
51
| |_____^ help: you can reduce it to: `!(x && y)`
52
52
53
53
error: this if-then-else expression will always return true
54
- --> $DIR/needless_bool.rs:74 :5
54
+ --> $DIR/needless_bool.rs:75 :5
55
55
|
56
56
LL | / if x {
57
57
LL | | return true;
@@ -61,7 +61,7 @@ LL | | };
61
61
| |_____^
62
62
63
63
error: this if-then-else expression will always return false
64
- --> $DIR/needless_bool.rs:83 :5
64
+ --> $DIR/needless_bool.rs:84 :5
65
65
|
66
66
LL | / if x {
67
67
LL | | return false;
@@ -71,7 +71,7 @@ LL | | };
71
71
| |_____^
72
72
73
73
error: this if-then-else expression returns a bool literal
74
- --> $DIR/needless_bool.rs:92 :5
74
+ --> $DIR/needless_bool.rs:93 :5
75
75
|
76
76
LL | / if x {
77
77
LL | | return true;
@@ -81,7 +81,7 @@ LL | | };
81
81
| |_____^ help: you can reduce it to: `return x`
82
82
83
83
error: this if-then-else expression returns a bool literal
84
- --> $DIR/needless_bool.rs:101 :5
84
+ --> $DIR/needless_bool.rs:102 :5
85
85
|
86
86
LL | / if x && y {
87
87
LL | | return true;
@@ -91,7 +91,7 @@ LL | | };
91
91
| |_____^ help: you can reduce it to: `return x && y`
92
92
93
93
error: this if-then-else expression returns a bool literal
94
- --> $DIR/needless_bool.rs:110 :5
94
+ --> $DIR/needless_bool.rs:111 :5
95
95
|
96
96
LL | / if x {
97
97
LL | | return false;
@@ -101,7 +101,7 @@ LL | | };
101
101
| |_____^ help: you can reduce it to: `return !x`
102
102
103
103
error: this if-then-else expression returns a bool literal
104
- --> $DIR/needless_bool.rs:119 :5
104
+ --> $DIR/needless_bool.rs:120 :5
105
105
|
106
106
LL | / if x && y {
107
107
LL | | return false;
@@ -111,41 +111,41 @@ LL | | };
111
111
| |_____^ help: you can reduce it to: `return !(x && y)`
112
112
113
113
error: equality checks against true are unnecessary
114
- --> $DIR/needless_bool.rs:127 :8
114
+ --> $DIR/needless_bool.rs:128 :8
115
115
|
116
116
LL | if x == true {};
117
117
| ^^^^^^^^^ help: try simplifying it as shown: `x`
118
118
|
119
119
= note: `-D clippy::bool-comparison` implied by `-D warnings`
120
120
121
121
error: equality checks against false can be replaced by a negation
122
- --> $DIR/needless_bool.rs:131 :8
122
+ --> $DIR/needless_bool.rs:132 :8
123
123
|
124
124
LL | if x == false {};
125
125
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
126
126
127
127
error: equality checks against true are unnecessary
128
- --> $DIR/needless_bool.rs:141 :8
128
+ --> $DIR/needless_bool.rs:142 :8
129
129
|
130
130
LL | if x == true {};
131
131
| ^^^^^^^^^ help: try simplifying it as shown: `x`
132
132
133
133
error: equality checks against false can be replaced by a negation
134
- --> $DIR/needless_bool.rs:142 :8
134
+ --> $DIR/needless_bool.rs:143 :8
135
135
|
136
136
LL | if x == false {};
137
137
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
138
138
139
139
error: this if-then-else expression returns a bool literal
140
- --> $DIR/needless_bool.rs:151 :12
140
+ --> $DIR/needless_bool.rs:152 :12
141
141
|
142
142
LL | } else if returns_bool() {
143
143
| ____________^
144
144
LL | | false
145
145
LL | | } else {
146
146
LL | | true
147
147
LL | | };
148
- | |_____^ help: you can reduce it to: `!returns_bool()`
148
+ | |_____^ help: you can reduce it to: `{ !returns_bool() } `
149
149
150
150
error: aborting due to 16 previous errors
151
151
0 commit comments