File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ // rustfmt-edition: 2018
2+
3+ fn main ( ) -> Result < ( ) , !> {
4+ let _x: Option < _ > = try {
5+ 4
6+ } ;
7+
8+ try { }
9+ }
10+
11+ fn baz ( ) -> Option < i32 > {
12+ if ( 1 == 1 ) {
13+ return try {
14+ 5
15+ } ;
16+ }
17+
18+ // test
19+ let x: Option < ( ) > = try {
20+ // try blocks are great
21+ } ;
22+
23+ let y: Option < i32 > = try {
24+ 6
25+ } ; // comment
26+
27+ let x: Option < i32 > = try { baz ( ) ?; baz ( ) ?; baz ( ) ?; 7 } ;
28+
29+ return None ;
30+ }
Original file line number Diff line number Diff line change 1+ // rustfmt-edition: 2018
2+
3+ fn main ( ) -> Result < ( ) , !> {
4+ let _x: Option < _ > = try { 4 } ;
5+
6+ try { }
7+ }
8+
9+ fn baz ( ) -> Option < i32 > {
10+ if ( 1 == 1 ) {
11+ return try { 5 } ;
12+ }
13+
14+ // test
15+ let x: Option < ( ) > = try {
16+ // try blocks are great
17+ } ;
18+
19+ let y: Option < i32 > = try { 6 } ; // comment
20+
21+ let x: Option < i32 > = try {
22+ baz ( ) ?;
23+ baz ( ) ?;
24+ baz ( ) ?;
25+ 7
26+ } ;
27+
28+ return None ;
29+ }
You can’t perform that action at this time.
0 commit comments