@@ -281,7 +281,7 @@ macro_rules! extension_trait {
281
281
#[ cfg( feature = "docs" ) ]
282
282
#[ doc = $doc]
283
283
pub trait $name {
284
- extension_trait!( @doc ( ) $( $body_base) * $( $body_ext) * ) ;
284
+ extension_trait!( @doc [ $( $body_base) * $( $body_ext) * ] -> [ ] ) ;
285
285
}
286
286
287
287
// When not rendering docs, re-export the base trait from the futures crate.
@@ -291,7 +291,7 @@ macro_rules! extension_trait {
291
291
// The extension trait that adds methods to any type implementing the base trait.
292
292
#[ doc = $doc_ext]
293
293
pub trait $ext: $name {
294
- extension_trait!( @ext ( ) $( $body_ext) * ) ;
294
+ extension_trait!( @ext [ $( $body_ext) * ] -> [ ] ) ;
295
295
}
296
296
297
297
// Blanket implementation of the extension trait for any type implementing the base trait.
@@ -302,24 +302,24 @@ macro_rules! extension_trait {
302
302
} ;
303
303
304
304
// Parse the return type in an extension method.
305
- ( @doc ( $ ( $head : tt ) * ) -> impl Future <Output = $out: ty> $( + $lt: lifetime) ? [ $f: ty] $( $tail: tt) * ) => {
306
- extension_trait!( @doc ( $ ( $head ) * -> owned:: ImplFuture <$out>) $ ( $tail ) * ) ;
305
+ ( @doc [ -> impl Future <Output = $out: ty> $( + $lt: lifetime) ? [ $f: ty] $( $tail: tt) * ] -> [ $ ( $accum : tt ) * ] ) => {
306
+ extension_trait!( @doc [ $ ( $tail ) * ] -> [ $ ( $accum ) * -> owned:: ImplFuture <$out>] ) ;
307
307
} ;
308
- ( @ext ( $ ( $head : tt ) * ) -> impl Future <Output = $out: ty> $( + $lt: lifetime) ? [ $f: ty] $( $tail: tt) * ) => {
309
- extension_trait!( @ext ( $( $head ) * -> $f ) $ ( $tail ) * ) ;
308
+ ( @ext [ -> impl Future <Output = $out: ty> $( + $lt: lifetime) ? [ $f: ty] $( $tail: tt) * ] -> [ $ ( $accum : tt ) * ] ) => {
309
+ extension_trait!( @ext [ $( $tail ) * ] -> [ $ ( $accum ) * -> $f ] ) ;
310
310
} ;
311
311
312
312
// Parse a token.
313
- ( @doc ( $ ( $head : tt) * ) $token : tt $( $tail : tt) * ) => {
314
- extension_trait!( @doc ( $( $head ) * $token ) $( $tail ) * ) ;
313
+ ( @doc [ $token : tt $ ( $tail : tt) * ] -> [ $( $accum : tt) * ] ) => {
314
+ extension_trait!( @doc [ $( $tail ) * ] -> [ $( $accum ) * $token ] ) ;
315
315
} ;
316
- ( @ext ( $ ( $head : tt) * ) $token : tt $( $tail : tt) * ) => {
317
- extension_trait!( @ext ( $( $head ) * $token ) $( $tail ) * ) ;
316
+ ( @ext [ $token : tt $ ( $tail : tt) * ] -> [ $( $accum : tt) * ] ) => {
317
+ extension_trait!( @ext [ $( $tail ) * ] -> [ $( $accum ) * $token ] ) ;
318
318
} ;
319
319
320
320
// Handle the end of the token list.
321
- ( @doc ( $( $head : tt) * ) ) => { $( $head ) * } ;
322
- ( @ext ( $( $head : tt) * ) ) => { $( $head ) * } ;
321
+ ( @doc [ ] -> [ $( $accum : tt) * ] ) => { $( $accum ) * } ;
322
+ ( @ext [ ] -> [ $( $accum : tt) * ] ) => { $( $accum ) * } ;
323
323
324
324
// Parse imports at the beginning of the macro.
325
325
( $import: item $( $tail: tt) * ) => {
0 commit comments