]>
Commit | Line | Data |
---|---|---|
f20569fa | 1 | error: this if-then-else expression returns a bool literal |
136023e0 | 2 | --> $DIR/fixable.rs:40:5 |
f20569fa XL |
3 | | |
4 | LL | / if x { | |
5 | LL | | true | |
6 | LL | | } else { | |
7 | LL | | false | |
8 | LL | | }; | |
9 | | |_____^ help: you can reduce it to: `x` | |
10 | | | |
11 | = note: `-D clippy::needless-bool` implied by `-D warnings` | |
12 | ||
13 | error: this if-then-else expression returns a bool literal | |
136023e0 | 14 | --> $DIR/fixable.rs:45:5 |
f20569fa XL |
15 | | |
16 | LL | / if x { | |
17 | LL | | false | |
18 | LL | | } else { | |
19 | LL | | true | |
20 | LL | | }; | |
21 | | |_____^ help: you can reduce it to: `!x` | |
22 | ||
23 | error: this if-then-else expression returns a bool literal | |
136023e0 | 24 | --> $DIR/fixable.rs:50:5 |
f20569fa XL |
25 | | |
26 | LL | / if x && y { | |
27 | LL | | false | |
28 | LL | | } else { | |
29 | LL | | true | |
30 | LL | | }; | |
31 | | |_____^ help: you can reduce it to: `!(x && y)` | |
32 | ||
33 | error: this if-then-else expression returns a bool literal | |
136023e0 | 34 | --> $DIR/fixable.rs:70:5 |
f20569fa XL |
35 | | |
36 | LL | / if x { | |
37 | LL | | return true; | |
38 | LL | | } else { | |
39 | LL | | return false; | |
40 | LL | | }; | |
41 | | |_____^ help: you can reduce it to: `return x` | |
42 | ||
43 | error: this if-then-else expression returns a bool literal | |
136023e0 | 44 | --> $DIR/fixable.rs:78:5 |
f20569fa XL |
45 | | |
46 | LL | / if x { | |
47 | LL | | return false; | |
48 | LL | | } else { | |
49 | LL | | return true; | |
50 | LL | | }; | |
51 | | |_____^ help: you can reduce it to: `return !x` | |
52 | ||
53 | error: this if-then-else expression returns a bool literal | |
136023e0 | 54 | --> $DIR/fixable.rs:86:5 |
f20569fa XL |
55 | | |
56 | LL | / if x && y { | |
57 | LL | | return true; | |
58 | LL | | } else { | |
59 | LL | | return false; | |
60 | LL | | }; | |
61 | | |_____^ help: you can reduce it to: `return x && y` | |
62 | ||
63 | error: this if-then-else expression returns a bool literal | |
136023e0 | 64 | --> $DIR/fixable.rs:94:5 |
f20569fa XL |
65 | | |
66 | LL | / if x && y { | |
67 | LL | | return false; | |
68 | LL | | } else { | |
69 | LL | | return true; | |
70 | LL | | }; | |
71 | | |_____^ help: you can reduce it to: `return !(x && y)` | |
72 | ||
73 | error: equality checks against true are unnecessary | |
136023e0 | 74 | --> $DIR/fixable.rs:102:8 |
f20569fa XL |
75 | | |
76 | LL | if x == true {}; | |
77 | | ^^^^^^^^^ help: try simplifying it as shown: `x` | |
78 | | | |
79 | = note: `-D clippy::bool-comparison` implied by `-D warnings` | |
80 | ||
81 | error: equality checks against false can be replaced by a negation | |
136023e0 | 82 | --> $DIR/fixable.rs:106:8 |
f20569fa XL |
83 | | |
84 | LL | if x == false {}; | |
85 | | ^^^^^^^^^^ help: try simplifying it as shown: `!x` | |
86 | ||
87 | error: equality checks against true are unnecessary | |
136023e0 | 88 | --> $DIR/fixable.rs:116:8 |
f20569fa XL |
89 | | |
90 | LL | if x == true {}; | |
91 | | ^^^^^^^^^ help: try simplifying it as shown: `x` | |
92 | ||
93 | error: equality checks against false can be replaced by a negation | |
136023e0 | 94 | --> $DIR/fixable.rs:117:8 |
f20569fa XL |
95 | | |
96 | LL | if x == false {}; | |
97 | | ^^^^^^^^^^ help: try simplifying it as shown: `!x` | |
98 | ||
99 | error: this if-then-else expression returns a bool literal | |
136023e0 | 100 | --> $DIR/fixable.rs:126:12 |
f20569fa XL |
101 | | |
102 | LL | } else if returns_bool() { | |
103 | | ____________^ | |
104 | LL | | false | |
105 | LL | | } else { | |
106 | LL | | true | |
107 | LL | | }; | |
108 | | |_____^ help: you can reduce it to: `{ !returns_bool() }` | |
109 | ||
110 | error: aborting due to 12 previous errors | |
111 |