2020-01-07 00:06:23 -06:00
|
|
|
error: this `else { if .. }` block can be collapsed
|
2021-01-04 01:25:38 -06:00
|
|
|
--> $DIR/collapsible_else_if.rs:14:12
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | if y == "world" {
|
|
|
|
LL | | println!("world!")
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2021-01-04 01:25:38 -06:00
|
|
|
= note: `-D clippy::collapsible-else-if` implied by `-D warnings`
|
2020-06-19 04:44:03 -05:00
|
|
|
help: collapse nested if block
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else if y == "world" {
|
2020-02-04 09:13:06 -06:00
|
|
|
LL | println!("world!")
|
|
|
|
LL | }
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2021-01-04 01:25:38 -06:00
|
|
|
--> $DIR/collapsible_else_if.rs:22:12
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | if let Some(42) = Some(42) {
|
|
|
|
LL | | println!("world!")
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2020-06-19 04:44:03 -05:00
|
|
|
help: collapse nested if block
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else if let Some(42) = Some(42) {
|
2020-02-04 09:13:06 -06:00
|
|
|
LL | println!("world!")
|
|
|
|
LL | }
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2021-01-04 01:25:38 -06:00
|
|
|
--> $DIR/collapsible_else_if.rs:30:12
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | if y == "world" {
|
|
|
|
LL | | println!("world")
|
|
|
|
LL | | }
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2020-06-19 04:44:03 -05:00
|
|
|
help: collapse nested if block
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else if y == "world" {
|
2020-02-04 09:13:06 -06:00
|
|
|
LL | println!("world")
|
|
|
|
LL | }
|
|
|
|
LL | else {
|
|
|
|
LL | println!("!")
|
|
|
|
LL | }
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2021-01-04 01:25:38 -06:00
|
|
|
--> $DIR/collapsible_else_if.rs:41:12
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | if let Some(42) = Some(42) {
|
|
|
|
LL | | println!("world")
|
|
|
|
LL | | }
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2020-06-19 04:44:03 -05:00
|
|
|
help: collapse nested if block
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else if let Some(42) = Some(42) {
|
2020-02-04 09:13:06 -06:00
|
|
|
LL | println!("world")
|
|
|
|
LL | }
|
|
|
|
LL | else {
|
|
|
|
LL | println!("!")
|
|
|
|
LL | }
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2021-01-04 01:25:38 -06:00
|
|
|
--> $DIR/collapsible_else_if.rs:52:12
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | if let Some(42) = Some(42) {
|
|
|
|
LL | | println!("world")
|
|
|
|
LL | | }
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2020-06-19 04:44:03 -05:00
|
|
|
help: collapse nested if block
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else if let Some(42) = Some(42) {
|
2020-02-04 09:13:06 -06:00
|
|
|
LL | println!("world")
|
|
|
|
LL | }
|
|
|
|
LL | else {
|
|
|
|
LL | println!("!")
|
|
|
|
LL | }
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2021-01-04 01:25:38 -06:00
|
|
|
--> $DIR/collapsible_else_if.rs:63:12
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | if x == "hello" {
|
|
|
|
LL | | println!("world")
|
|
|
|
LL | | }
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2020-06-19 04:44:03 -05:00
|
|
|
help: collapse nested if block
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else if x == "hello" {
|
2020-02-04 09:13:06 -06:00
|
|
|
LL | println!("world")
|
|
|
|
LL | }
|
|
|
|
LL | else {
|
|
|
|
LL | println!("!")
|
|
|
|
LL | }
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2021-01-04 01:25:38 -06:00
|
|
|
--> $DIR/collapsible_else_if.rs:74:12
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | if let Some(42) = Some(42) {
|
|
|
|
LL | | println!("world")
|
|
|
|
LL | | }
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2020-06-19 04:44:03 -05:00
|
|
|
help: collapse nested if block
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
LL | } else if let Some(42) = Some(42) {
|
2020-02-04 09:13:06 -06:00
|
|
|
LL | println!("world")
|
|
|
|
LL | }
|
|
|
|
LL | else {
|
|
|
|
LL | println!("!")
|
|
|
|
LL | }
|
2020-01-07 00:06:23 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
|
|
|
|