mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
34c6ba7354
Clippy should not lint 2 blocks expression for comparison_chain.
78 lines
1.8 KiB
Plaintext
78 lines
1.8 KiB
Plaintext
error: `if` chain can be rewritten with `match`
|
|
--> tests/ui/comparison_chain.rs:29:5
|
|
|
|
|
LL | / if x > y {
|
|
LL | |
|
|
LL | |
|
|
LL | | a()
|
|
... |
|
|
LL | | c()
|
|
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:39: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:49: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:132: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:142: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:249: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 6 previous errors
|
|
|