101 lines
2.4 KiB
Text
101 lines
2.4 KiB
Text
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:15:5
|
|
|
|
|
LL | / if x > y {
|
|
LL | |
|
|
LL | |
|
|
LL | | a()
|
|
LL | | } else if x < y {
|
|
LL | | b()
|
|
LL | | }
|
|
| |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
|
|
|
|
|
= note: `-D clippy::comparison-chain` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::comparison_chain)]`
|
|
|
|
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:30:5
|
|
|
|
|
LL | / if x > y {
|
|
LL | |
|
|
LL | |
|
|
LL | | a()
|
|
... |
|
|
LL | | c()
|
|
LL | | }
|
|
| |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
|
|
|
|
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:40:5
|
|
|
|
|
LL | / if x > y {
|
|
LL | |
|
|
LL | |
|
|
LL | | a()
|
|
... |
|
|
LL | | c()
|
|
LL | | }
|
|
| |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
|
|
|
|
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:50:5
|
|
|
|
|
LL | / if x > 1 {
|
|
LL | |
|
|
LL | |
|
|
LL | | a()
|
|
... |
|
|
LL | | c()
|
|
LL | | }
|
|
| |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&1) {...}`
|
|
|
|
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:126:5
|
|
|
|
|
LL | / if x > y {
|
|
LL | |
|
|
LL | |
|
|
LL | | a()
|
|
LL | | } else if x < y {
|
|
LL | | b()
|
|
LL | | }
|
|
| |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
|
|
|
|
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:134:5
|
|
|
|
|
LL | / if x > y {
|
|
LL | |
|
|
LL | |
|
|
LL | | a()
|
|
... |
|
|
LL | | c()
|
|
LL | | }
|
|
| |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
|
|
|
|
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:144:5
|
|
|
|
|
LL | / if x > y {
|
|
LL | |
|
|
LL | |
|
|
LL | | a()
|
|
... |
|
|
LL | | c()
|
|
LL | | }
|
|
| |_____^ help: consider rewriting the `if` chain with `match`: `match x.cmp(&y) {...}`
|
|
|
|
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:251:5
|
|
|
|
|
LL | / if x + 1 > y * 2 {
|
|
LL | |
|
|
LL | |
|
|
LL | | "aa"
|
|
... |
|
|
LL | | "cc"
|
|
LL | | }
|
|
| |_____^ help: consider rewriting the `if` chain with `match`: `match (x + 1).cmp(&(y * 2)) {...}`
|
|
|
|
error: aborting due to 8 previous errors
|
|
|