File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -506,6 +506,22 @@ cfg_remote! {
506506}
507507
508508cfg_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+
509525 impl Remote {
510526 fn connector<C >( mut self , connector: C ) -> Remote
511527 where
@@ -514,15 +530,7 @@ cfg_replication_or_remote_or_sync! {
514530 C :: Future : Send + ' static ,
515531 C :: Error : Into <Box <dyn std:: error:: Error + Send + Sync >>,
516532 {
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) ) ;
526534 self
527535 }
528536
You can’t perform that action at this time.
0 commit comments