File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,24 @@ macro_rules! crossbeam_channel_internal {
9090 } ;
9191 // Print an error if there is a semicolon after the block.
9292 ( @list
93- ( $case: ident $args: tt $( -> $res: pat) * => $ body: block ; $( $tail: tt) * )
93+ ( $case: ident $args: tt $( -> $res: pat) * => { $ ( $ body: tt ) * } ; $( $tail: tt) * )
9494 ( $( $head: tt) * )
9595 ) => {
9696 compile_error!(
9797 "did you mean to put a comma instead of the semicolon after `}`?"
9898 )
9999 } ;
100100 // The first case is separated by a comma.
101+ ( @list
102+ ( $case: ident ( $( $args: tt) * ) $( -> $res: pat) * => { $( $body: tt) * } , $( $tail: tt) * )
103+ ( $( $head: tt) * )
104+ ) => {
105+ $crate:: crossbeam_channel_internal!(
106+ @list
107+ ( $( $tail) * )
108+ ( $( $head) * $case ( $( $args) * ) $( -> $res) * => { $( $body) * } , )
109+ )
110+ } ;
101111 ( @list
102112 ( $case: ident ( $( $args: tt) * ) $( -> $res: pat) * => $body: expr, $( $tail: tt) * )
103113 ( $( $head: tt) * )
@@ -110,13 +120,13 @@ macro_rules! crossbeam_channel_internal {
110120 } ;
111121 // Don't require a comma after the case if it has a proper block.
112122 ( @list
113- ( $case: ident ( $( $args: tt) * ) $( -> $res: pat) * => $ body: block $( $tail: tt) * )
123+ ( $case: ident ( $( $args: tt) * ) $( -> $res: pat) * => { $ ( $ body: tt ) * } $( $tail: tt) * )
114124 ( $( $head: tt) * )
115125 ) => {
116126 $crate:: crossbeam_channel_internal!(
117127 @list
118128 ( $( $tail) * )
119- ( $( $head) * $case ( $( $args) * ) $( -> $res) * => { $body } , )
129+ ( $( $head) * $case ( $( $args) * ) $( -> $res) * => { $( $ body) * } , )
120130 )
121131 } ;
122132 // Only one case remains.
You can’t perform that action at this time.
0 commit comments