File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,22 @@ cfg_remote! {
506
506
}
507
507
508
508
cfg_replication_or_remote_or_sync ! {
509
+ fn wrap_connector<C >( connector: C ) -> crate :: util:: ConnectorService
510
+ where
511
+ C : tower:: Service <http:: Uri > + Send + Clone + Sync + ' static ,
512
+ C :: Response : crate :: util:: Socket ,
513
+ C :: Future : Send + ' static ,
514
+ C :: Error : Into <Box <dyn std:: error:: Error + Send + Sync >>,
515
+ {
516
+ use tower:: ServiceExt ;
517
+
518
+ let svc = connector
519
+ . map_err( |e| e. into( ) )
520
+ . map_response( |s| Box :: new( s) as Box <dyn crate :: util:: Socket >) ;
521
+
522
+ crate :: util:: ConnectorService :: new( svc)
523
+ }
524
+
509
525
impl Remote {
510
526
fn connector<C >( mut self , connector: C ) -> Remote
511
527
where
@@ -514,15 +530,7 @@ cfg_replication_or_remote_or_sync! {
514
530
C :: Future : Send + ' static ,
515
531
C :: Error : Into <Box <dyn std:: error:: Error + Send + Sync >>,
516
532
{
517
- use tower:: ServiceExt ;
518
-
519
- let svc = connector
520
- . map_err( |e| e. into( ) )
521
- . map_response( |s| Box :: new( s) as Box <dyn crate :: util:: Socket >) ;
522
-
523
- let svc = crate :: util:: ConnectorService :: new( svc) ;
524
-
525
- self . connector = Some ( svc) ;
533
+ self . connector = Some ( wrap_connector( connector) ) ;
526
534
self
527
535
}
528
536
You can’t perform that action at this time.
0 commit comments