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