@@ -381,7 +381,7 @@ macro_rules! event_service_types {
381
381
type Error = $crate:: Error ;
382
382
type Future = :: futures:: future:: Either <
383
383
$crate:: handler:: WrapErrorFuture <Service :: Future , Service :: Error >,
384
- $crate :: handler :: WrapErrorFuture < Fallback :: Future , Fallback :: Error > ,
384
+ Fallback :: Future ,
385
385
>;
386
386
} ;
387
387
}
@@ -399,9 +399,7 @@ macro_rules! event_service_poll_ready {
399
399
) ) ;
400
400
}
401
401
if let :: std:: result:: Result :: Err ( e) = :: futures:: ready!( self . fallback. poll_ready( cx) ) {
402
- return :: std:: task:: Poll :: Ready ( :: std:: result:: Result :: Err (
403
- $crate:: Error :: handler( e) ,
404
- ) ) ;
402
+ return :: std:: task:: Poll :: Ready ( :: std:: result:: Result :: Err ( e) ) ;
405
403
}
406
404
:: std:: task:: Poll :: Ready ( :: std:: result:: Result :: Ok ( ( ) ) )
407
405
}
@@ -416,9 +414,7 @@ macro_rules! event_service_call {
416
414
$crate:: Event :: $v( $i) => :: futures:: future:: Either :: Left (
417
415
$crate:: handler:: WrapErrorFuture :: new( self . inner. call( $i) ) ,
418
416
) ,
419
- event => :: futures:: future:: Either :: Right ( $crate:: handler:: WrapErrorFuture :: new(
420
- self . fallback. call( event) ,
421
- ) ) ,
417
+ event => :: futures:: future:: Either :: Right ( self . fallback. call( event) ) ,
422
418
}
423
419
}
424
420
} ;
@@ -432,9 +428,7 @@ macro_rules! event_service_call {
432
428
$crate:: Event :: $v( $i) => :: futures:: future:: Either :: Left (
433
429
$crate:: handler:: WrapErrorFuture :: new( self . inner. call( $e) ) ,
434
430
) ,
435
- event => :: futures:: future:: Either :: Right ( $crate:: handler:: WrapErrorFuture :: new(
436
- self . fallback. call( ( $s, event) . into( ) ) ,
437
- ) ) ,
431
+ event => :: futures:: future:: Either :: Right ( self . fallback. call( ( $s, event) ) ) ,
438
432
}
439
433
}
440
434
} ;
@@ -462,10 +456,7 @@ macro_rules! event_service {
462
456
Service :: Error : :: std:: convert:: Into <:: std:: boxed:: Box <
463
457
dyn :: std:: error:: Error + :: std:: marker:: Send + :: std:: marker:: Sync + ' static ,
464
458
>>,
465
- Fallback : :: tower:: Service <$crate:: Event , Response = ( ) >,
466
- Fallback :: Error : :: std:: convert:: Into <:: std:: boxed:: Box <
467
- dyn :: std:: error:: Error + :: std:: marker:: Send + :: std:: marker:: Sync + ' static ,
468
- >>,
459
+ Fallback : :: tower:: Service <$crate:: Event , Response = ( ) , Error = $crate:: Error >,
469
460
{
470
461
$crate:: macros:: event_service_types! { }
471
462
$crate:: macros:: event_service_poll_ready! { }
@@ -479,34 +470,15 @@ macro_rules! event_service {
479
470
Service :: Error : :: std:: convert:: Into <:: std:: boxed:: Box <
480
471
dyn :: std:: error:: Error + :: std:: marker:: Send + :: std:: marker:: Sync + ' static ,
481
472
>>,
482
- Fallback : :: tower:: Service <( State , $crate:: handler:: Event ) , Response = ( ) >,
483
- Fallback :: Error : :: std:: convert:: Into <:: std:: boxed:: Box <
484
- dyn :: std:: error:: Error + :: std:: marker:: Send + :: std:: marker:: Sync + ' static ,
485
- >>,
486
- {
487
- $crate:: macros:: event_service_types! { }
488
- $crate:: macros:: event_service_poll_ready! { }
489
- $crate:: macros:: event_service_call! { state; [ < $e: camel >] ( e) => e }
490
- }
491
-
492
- impl <State , Service , Fallback > :: tower:: Service <( State , $crate:: handler:: Event ) >
493
- for [ < On $e: camel >] <Service , Fallback , ( $crate:: payloads:: [ < $e: camel Payload >] , ) >
494
- where
495
- Service : :: tower:: Service <
496
- ( $crate:: payloads:: [ < $e: camel Payload >] , ) ,
473
+ Fallback : :: tower:: Service <
474
+ ( State , $crate:: handler:: Event ) ,
497
475
Response = ( ) ,
476
+ Error = $crate:: Error ,
498
477
>,
499
- Service :: Error : :: std:: convert:: Into <:: std:: boxed:: Box <
500
- dyn :: std:: error:: Error + :: std:: marker:: Send + :: std:: marker:: Sync + ' static ,
501
- >>,
502
- Fallback : :: tower:: Service <( State , $crate:: handler:: Event ) , Response = ( ) >,
503
- Fallback :: Error : :: std:: convert:: Into <:: std:: boxed:: Box <
504
- dyn :: std:: error:: Error + :: std:: marker:: Send + :: std:: marker:: Sync + ' static ,
505
- >>,
506
478
{
507
479
$crate:: macros:: event_service_types! { }
508
480
$crate:: macros:: event_service_poll_ready! { }
509
- $crate:: macros:: event_service_call! { state; [ < $e: camel >] ( e) => ( e , ) }
481
+ $crate:: macros:: event_service_call! { state; [ < $e: camel >] ( e) => e }
510
482
}
511
483
512
484
impl <State , Service , Fallback > :: tower:: Service <( State , $crate:: handler:: Event ) >
@@ -519,10 +491,11 @@ macro_rules! event_service {
519
491
Service :: Error : :: std:: convert:: Into <:: std:: boxed:: Box <
520
492
dyn :: std:: error:: Error + :: std:: marker:: Send + :: std:: marker:: Sync + ' static ,
521
493
>>,
522
- Fallback : :: tower:: Service <( State , $crate:: handler:: Event ) , Response = ( ) >,
523
- Fallback :: Error : :: std:: convert:: Into <:: std:: boxed:: Box <
524
- dyn :: std:: error:: Error + :: std:: marker:: Send + :: std:: marker:: Sync + ' static ,
525
- >>,
494
+ Fallback : :: tower:: Service <
495
+ ( State , $crate:: handler:: Event ) ,
496
+ Response = ( ) ,
497
+ Error = $crate:: Error
498
+ >,
526
499
{
527
500
$crate:: macros:: event_service_types! { }
528
501
$crate:: macros:: event_service_poll_ready! { }
0 commit comments