2017-02-07 14:05:30 -06:00
|
|
|
error: this if statement can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:8:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
8 | / if x == "hello" {
|
2017-05-11 05:00:31 -05:00
|
|
|
9 | | if y == "world" {
|
|
|
|
10 | | println!("Hello world!");
|
|
|
|
11 | | }
|
|
|
|
12 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-17 07:19:44 -05:00
|
|
|
= note: `-D collapsible-if` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
help: try
|
|
|
|
| if x == "hello" && y == "world" {
|
|
|
|
| println!("Hello world!");
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this if statement can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:14:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
14 | / if x == "hello" || x == "world" {
|
|
|
|
15 | | if y == "world" || y == "hello" {
|
|
|
|
16 | | println!("Hello world!");
|
|
|
|
17 | | }
|
|
|
|
18 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
|
|
|
|
| println!("Hello world!");
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this if statement can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:20:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
20 | / if x == "hello" && x == "world" {
|
|
|
|
21 | | if y == "world" || y == "hello" {
|
|
|
|
22 | | println!("Hello world!");
|
|
|
|
23 | | }
|
|
|
|
24 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| if x == "hello" && x == "world" && (y == "world" || y == "hello") {
|
|
|
|
| println!("Hello world!");
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this if statement can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:26:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
26 | / if x == "hello" || x == "world" {
|
|
|
|
27 | | if y == "world" && y == "hello" {
|
|
|
|
28 | | println!("Hello world!");
|
|
|
|
29 | | }
|
|
|
|
30 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| if (x == "hello" || x == "world") && y == "world" && y == "hello" {
|
|
|
|
| println!("Hello world!");
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this if statement can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:32:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
32 | / if x == "hello" && x == "world" {
|
|
|
|
33 | | if y == "world" && y == "hello" {
|
|
|
|
34 | | println!("Hello world!");
|
|
|
|
35 | | }
|
|
|
|
36 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| if x == "hello" && x == "world" && y == "world" && y == "hello" {
|
|
|
|
| println!("Hello world!");
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this if statement can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:38:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
38 | / if 42 == 1337 {
|
|
|
|
39 | | if 'a' != 'A' {
|
|
|
|
40 | | println!("world!")
|
|
|
|
41 | | }
|
|
|
|
42 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| if 42 == 1337 && 'a' != 'A' {
|
|
|
|
| println!("world!")
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:47:12
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
47 | } else {
|
2017-04-23 08:25:22 -05:00
|
|
|
| ____________^
|
2017-05-11 05:00:31 -05:00
|
|
|
48 | | if y == "world" {
|
|
|
|
49 | | println!("world!")
|
|
|
|
50 | | }
|
|
|
|
51 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| } else if y == "world" {
|
|
|
|
| println!("world!")
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:55:12
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
55 | } else {
|
2017-04-23 08:25:22 -05:00
|
|
|
| ____________^
|
2017-05-11 05:00:31 -05:00
|
|
|
56 | | if let Some(42) = Some(42) {
|
|
|
|
57 | | println!("world!")
|
|
|
|
58 | | }
|
|
|
|
59 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| } else if let Some(42) = Some(42) {
|
|
|
|
| println!("world!")
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:63:12
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
63 | } else {
|
2017-04-23 08:25:22 -05:00
|
|
|
| ____________^
|
2017-05-11 05:00:31 -05:00
|
|
|
64 | | if y == "world" {
|
|
|
|
65 | | println!("world")
|
|
|
|
66 | | }
|
2017-04-10 08:36:07 -05:00
|
|
|
... |
|
2017-05-11 05:00:31 -05:00
|
|
|
69 | | }
|
|
|
|
70 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| } else if y == "world" {
|
|
|
|
| println!("world")
|
|
|
|
| }
|
|
|
|
| else {
|
|
|
|
| println!("!")
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:74:12
|
2017-05-11 05:00:31 -05:00
|
|
|
|
|
|
|
|
74 | } else {
|
|
|
|
| ____________^
|
|
|
|
75 | | if let Some(42) = Some(42) {
|
|
|
|
76 | | println!("world")
|
|
|
|
77 | | }
|
|
|
|
... |
|
|
|
|
80 | | }
|
|
|
|
81 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
help: try
|
2017-05-11 05:00:31 -05:00
|
|
|
| } else if let Some(42) = Some(42) {
|
|
|
|
| println!("world")
|
|
|
|
| }
|
|
|
|
| else {
|
|
|
|
| println!("!")
|
|
|
|
| }
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:85:12
|
2017-05-11 05:00:31 -05:00
|
|
|
|
|
|
|
|
85 | } else {
|
|
|
|
| ____________^
|
|
|
|
86 | | if let Some(42) = Some(42) {
|
|
|
|
87 | | println!("world")
|
|
|
|
88 | | }
|
|
|
|
... |
|
|
|
|
91 | | }
|
|
|
|
92 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
help: try
|
2017-05-11 05:00:31 -05:00
|
|
|
| } else if let Some(42) = Some(42) {
|
|
|
|
| println!("world")
|
|
|
|
| }
|
|
|
|
| else {
|
|
|
|
| println!("!")
|
|
|
|
| }
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:96:12
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
96 | } else {
|
2017-04-23 08:25:22 -05:00
|
|
|
| ____________^
|
2017-05-11 05:00:31 -05:00
|
|
|
97 | | if x == "hello" {
|
|
|
|
98 | | println!("world")
|
|
|
|
99 | | }
|
2017-04-10 08:36:07 -05:00
|
|
|
... |
|
2017-05-11 05:00:31 -05:00
|
|
|
102 | | }
|
|
|
|
103 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| } else if x == "hello" {
|
|
|
|
| println!("world")
|
|
|
|
| }
|
|
|
|
| else {
|
|
|
|
| println!("!")
|
|
|
|
| }
|
|
|
|
|
|
|
|
error: this `else { if .. }` block can be collapsed
|
2017-05-17 10:51:35 -05:00
|
|
|
--> collapsible_if.rs:107:12
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-11 05:00:31 -05:00
|
|
|
107 | } else {
|
2017-04-23 08:25:22 -05:00
|
|
|
| ____________^
|
2017-05-11 05:00:31 -05:00
|
|
|
108 | | if let Some(42) = Some(42) {
|
|
|
|
109 | | println!("world")
|
|
|
|
110 | | }
|
2017-04-10 08:36:07 -05:00
|
|
|
... |
|
2017-05-11 05:00:31 -05:00
|
|
|
113 | | }
|
|
|
|
114 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| } else if let Some(42) = Some(42) {
|
|
|
|
| println!("world")
|
|
|
|
| }
|
|
|
|
| else {
|
|
|
|
| println!("!")
|
|
|
|
| }
|
|
|
|
|
2017-07-02 23:37:30 -05:00
|
|
|
error: aborting due to 13 previous errors
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2017-05-17 07:19:44 -05:00
|
|
|
|
|
|
|
To learn more, run the command again with --verbose.
|