11error: `if` chain can be rewritten with `match`
2- --> tests/ui/comparison_chain.rs:15 :5
2+ --> tests/ui/comparison_chain.rs:29 :5
33 |
44LL | / if x > y {
55LL | |
66LL | |
77LL | | a()
8- LL | | } else if x < y {
9- LL | | b ()
8+ ... |
9+ LL | | c ()
1010LL | | }
1111 | |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
1212 |
1313 = note: `-D clippy::comparison-chain` implied by `-D warnings`
1414 = help: to override `-D warnings` add `#[allow(clippy::comparison_chain)]`
1515
1616error: `if` chain can be rewritten with `match`
17- --> tests/ui/comparison_chain.rs:30:5
18- |
19- LL | / if x > y {
20- LL | |
21- LL | |
22- LL | | a()
23- ... |
24- LL | | c()
25- LL | | }
26- | |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
27-
28- error: `if` chain can be rewritten with `match`
29- --> tests/ui/comparison_chain.rs:40:5
17+ --> tests/ui/comparison_chain.rs:39:5
3018 |
3119LL | / if x > y {
3220LL | |
@@ -38,7 +26,7 @@ LL | | }
3826 | |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
3927
4028error: `if` chain can be rewritten with `match`
41- --> tests/ui/comparison_chain.rs:50 :5
29+ --> tests/ui/comparison_chain.rs:49 :5
4230 |
4331LL | / if x > 1 {
4432LL | |
@@ -50,19 +38,7 @@ LL | | }
5038 | |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&1) {...}`
5139
5240error: `if` chain can be rewritten with `match`
53- --> tests/ui/comparison_chain.rs:126:5
54- |
55- LL | / if x > y {
56- LL | |
57- LL | |
58- LL | | a()
59- LL | | } else if x < y {
60- LL | | b()
61- LL | | }
62- | |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
63-
64- error: `if` chain can be rewritten with `match`
65- --> tests/ui/comparison_chain.rs:134:5
41+ --> tests/ui/comparison_chain.rs:132:5
6642 |
6743LL | / if x > y {
6844LL | |
@@ -74,7 +50,7 @@ LL | | }
7450 | |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
7551
7652error: `if` chain can be rewritten with `match`
77- --> tests/ui/comparison_chain.rs:144 :5
53+ --> tests/ui/comparison_chain.rs:142 :5
7854 |
7955LL | / if x > y {
8056LL | |
@@ -86,7 +62,7 @@ LL | | }
8662 | |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
8763
8864error: `if` chain can be rewritten with `match`
89- --> tests/ui/comparison_chain.rs:251 :5
65+ --> tests/ui/comparison_chain.rs:249 :5
9066 |
9167LL | / if x + 1 > y * 2 {
9268LL | |
@@ -97,5 +73,5 @@ LL | | "cc"
9773LL | | }
9874 | |_____^ help: consider rewriting the `if` chain with `match`: `match (x + 1).cmp(&(y * 2)) {...}`
9975
100- error: aborting due to 8 previous errors
76+ error: aborting due to 6 previous errors
10177
0 commit comments