File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ fn paren_if(x: bool) -> u8 {
11
11
}
12
12
13
13
fn let_if ( x : bool ) -> u8 {
14
- let x = if x { 0 } else { 1 } ;
14
+ let x = if x {
15
+ foo ( )
16
+ } else {
17
+ bar ( )
18
+ } ;
15
19
x
16
20
}
17
21
@@ -22,3 +26,15 @@ fn return_if(x: bool) -> u8 {
22
26
1
23
27
} ;
24
28
}
29
+
30
+ fn multi_if ( ) {
31
+ use std:: io;
32
+ if x { foo ( ) } else { bar ( ) }
33
+ if x { foo ( ) } else { bar ( ) }
34
+ }
35
+
36
+ fn middle_if ( ) {
37
+ use std:: io;
38
+ if x { foo ( ) } else { bar ( ) }
39
+ let x = 1 ;
40
+ }
Original file line number Diff line number Diff line change @@ -7,10 +7,30 @@ fn paren_if(x: bool) -> u8 {
7
7
}
8
8
9
9
fn let_if ( x : bool ) -> u8 {
10
- let x = if x { 0 } else { 1 } ;
10
+ let x = if x { foo ( ) } else { bar ( ) } ;
11
11
x
12
12
}
13
13
14
14
fn return_if ( x : bool ) -> u8 {
15
15
return if x { 0 } else { 1 } ;
16
16
}
17
+
18
+ fn multi_if ( ) {
19
+ use std:: io;
20
+ if x {
21
+ foo ( )
22
+ } else {
23
+ bar ( )
24
+ }
25
+ if x { foo ( ) } else { bar ( ) }
26
+ }
27
+
28
+ fn middle_if ( ) {
29
+ use std:: io;
30
+ if x {
31
+ foo ( )
32
+ } else {
33
+ bar ( )
34
+ }
35
+ let x = 1 ;
36
+ }
You can’t perform that action at this time.
0 commit comments