mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 02:23:19 +00:00
154 lines
3 KiB
Text
154 lines
3 KiB
Text
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:12:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if y == "world" {
|
|
LL | | println!("world!")
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= note: `-D clippy::collapsible-if` implied by `-D warnings`
|
|
help: try
|
|
|
|
|
LL | } else if y == "world" {
|
|
LL | println!("world!")
|
|
LL | }
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
|
--> $DIR/collapsible_else_if.rs:20:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if let Some(42) = Some(42) {
|
|
LL | | println!("world!")
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: try
|
|
|
|
|
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:28:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if y == "world" {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: try
|
|
|
|
|
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:39:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if let Some(42) = Some(42) {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: try
|
|
|
|
|
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:50:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if let Some(42) = Some(42) {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: try
|
|
|
|
|
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:61:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if x == "hello" {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: try
|
|
|
|
|
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:72:12
|
|
|
|
|
LL | } else {
|
|
| ____________^
|
|
LL | | if let Some(42) = Some(42) {
|
|
LL | | println!("world")
|
|
LL | | }
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: try
|
|
|
|
|
LL | } else if let Some(42) = Some(42) {
|
|
LL | println!("world")
|
|
LL | }
|
|
LL | else {
|
|
LL | println!("!")
|
|
LL | }
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
|
|