mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-16 18:44:56 +00:00
155 lines
3.1 KiB
Plaintext
155 lines
3.1 KiB
Plaintext
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:14:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if y == "world" {
|
|
LL | | println!("world!")
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= note: `-D clippy::collapsible-else-if` implied by `-D warnings`
|
|
help: collapse nested if block
|
|
|
|
|
LL ~ } else if y == "world" {
|
|
LL + println!("world!")
|
|
LL + }
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:22:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if let Some(42) = Some(42) {
|
|
LL | | println!("world!")
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: collapse nested if block
|
|
|
|
|
LL ~ } else if let Some(42) = Some(42) {
|
|
LL + println!("world!")
|
|
LL + }
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:30:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if y == "world" {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: collapse nested if block
|
|
|
|
|
LL ~ } else if y == "world" {
|
|
LL + println!("world")
|
|
LL + }
|
|
LL + else {
|
|
LL + println!("!")
|
|
LL + }
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:41:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if let Some(42) = Some(42) {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: collapse nested if block
|
|
|
|
|
LL ~ } else if let Some(42) = Some(42) {
|
|
LL + println!("world")
|
|
LL + }
|
|
LL + else {
|
|
LL + println!("!")
|
|
LL + }
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:52:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if let Some(42) = Some(42) {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: collapse nested if block
|
|
|
|
|
LL ~ } else if let Some(42) = Some(42) {
|
|
LL + println!("world")
|
|
LL + }
|
|
LL + else {
|
|
LL + println!("!")
|
|
LL + }
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:63:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if x == "hello" {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: collapse nested if block
|
|
|
|
|
LL ~ } else if x == "hello" {
|
|
LL + println!("world")
|
|
LL + }
|
|
LL + else {
|
|
LL + println!("!")
|
|
LL + }
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:74:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if let Some(42) = Some(42) {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: collapse nested if block
|
|
|
|
|
LL ~ } else if let Some(42) = Some(42) {
|
|
LL + println!("world")
|
|
LL + }
|
|
LL + else {
|
|
LL + println!("!")
|
|
LL + }
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
|
|