error: this if statement can be collapsed --> $DIR/collapsible_if.rs:16:5 | 16 | / if x == "hello" { 17 | | if y == "world" { 18 | | println!("Hello world!"); 19 | | } 20 | | } | |_____^ | = note: `-D clippy::collapsible-if` implied by `-D warnings` help: try | 16 | if x == "hello" && y == "world" { 17 | println!("Hello world!"); 18 | } | error: this if statement can be collapsed --> $DIR/collapsible_if.rs:22:5 | 22 | / if x == "hello" || x == "world" { 23 | | if y == "world" || y == "hello" { 24 | | println!("Hello world!"); 25 | | } 26 | | } | |_____^ help: try | 22 | if (x == "hello" || x == "world") && (y == "world" || y == "hello") { 23 | println!("Hello world!"); 24 | } | error: this if statement can be collapsed --> $DIR/collapsible_if.rs:28:5 | 28 | / if x == "hello" && x == "world" { 29 | | if y == "world" || y == "hello" { 30 | | println!("Hello world!"); 31 | | } 32 | | } | |_____^ help: try | 28 | if x == "hello" && x == "world" && (y == "world" || y == "hello") { 29 | println!("Hello world!"); 30 | } | error: this if statement can be collapsed --> $DIR/collapsible_if.rs:34:5 | 34 | / if x == "hello" || x == "world" { 35 | | if y == "world" && y == "hello" { 36 | | println!("Hello world!"); 37 | | } 38 | | } | |_____^ help: try | 34 | if (x == "hello" || x == "world") && y == "world" && y == "hello" { 35 | println!("Hello world!"); 36 | } | error: this if statement can be collapsed --> $DIR/collapsible_if.rs:40:5 | 40 | / if x == "hello" && x == "world" { 41 | | if y == "world" && y == "hello" { 42 | | println!("Hello world!"); 43 | | } 44 | | } | |_____^ help: try | 40 | if x == "hello" && x == "world" && y == "world" && y == "hello" { 41 | println!("Hello world!"); 42 | } | error: this if statement can be collapsed --> $DIR/collapsible_if.rs:46:5 | 46 | / if 42 == 1337 { 47 | | if 'a' != 'A' { 48 | | println!("world!") 49 | | } 50 | | } | |_____^ help: try | 46 | if 42 == 1337 && 'a' != 'A' { 47 | println!("world!") 48 | } | error: this `else { if .. }` block can be collapsed --> $DIR/collapsible_if.rs:55:12 | 55 | } else { | ____________^ 56 | | if y == "world" { 57 | | println!("world!") 58 | | } 59 | | } | |_____^ help: try | 55 | } else if y == "world" { 56 | println!("world!") 57 | } | error: this `else { if .. }` block can be collapsed --> $DIR/collapsible_if.rs:63:12 | 63 | } else { | ____________^ 64 | | if let Some(42) = Some(42) { 65 | | println!("world!") 66 | | } 67 | | } | |_____^ help: try | 63 | } else if let Some(42) = Some(42) { 64 | println!("world!") 65 | } | error: this `else { if .. }` block can be collapsed --> $DIR/collapsible_if.rs:71:12 | 71 | } else { | ____________^ 72 | | if y == "world" { 73 | | println!("world") 74 | | } ... | 77 | | } 78 | | } | |_____^ help: try | 71 | } else if y == "world" { 72 | println!("world") 73 | } 74 | else { 75 | println!("!") 76 | } | error: this `else { if .. }` block can be collapsed --> $DIR/collapsible_if.rs:82:12 | 82 | } else { | ____________^ 83 | | if let Some(42) = Some(42) { 84 | | println!("world") 85 | | } ... | 88 | | } 89 | | } | |_____^ help: try | 82 | } else if let Some(42) = Some(42) { 83 | println!("world") 84 | } 85 | else { 86 | println!("!") 87 | } | error: this `else { if .. }` block can be collapsed --> $DIR/collapsible_if.rs:93:12 | 93 | } else { | ____________^ 94 | | if let Some(42) = Some(42) { 95 | | println!("world") 96 | | } ... | 99 | | } 100 | | } | |_____^ help: try | 93 | } else if let Some(42) = Some(42) { 94 | println!("world") 95 | } 96 | else { 97 | println!("!") 98 | } | error: this `else { if .. }` block can be collapsed --> $DIR/collapsible_if.rs:104:12 | 104 | } else { | ____________^ 105 | | if x == "hello" { 106 | | println!("world") 107 | | } ... | 110 | | } 111 | | } | |_____^ help: try | 104 | } else if x == "hello" { 105 | println!("world") 106 | } 107 | else { 108 | println!("!") 109 | } | error: this `else { if .. }` block can be collapsed --> $DIR/collapsible_if.rs:115:12 | 115 | } else { | ____________^ 116 | | if let Some(42) = Some(42) { 117 | | println!("world") 118 | | } ... | 121 | | } 122 | | } | |_____^ help: try | 115 | } else if let Some(42) = Some(42) { 116 | println!("world") 117 | } 118 | else { 119 | println!("!") 120 | } | error: this if statement can be collapsed --> $DIR/collapsible_if.rs:174:5 | 174 | / if x == "hello" { 175 | | if y == "world" { // Collapsible 176 | | println!("Hello world!"); 177 | | } 178 | | } | |_____^ help: try | 174 | if x == "hello" && y == "world" { // Collapsible 175 | println!("Hello world!"); 176 | } | error: aborting due to 14 previous errors