File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,8 @@ impl InputProtocol for NatsProtocol {
3636 }
3737
3838 fn init ( & self ) -> Result < ( ) , Box < dyn std:: error:: Error + Send > > {
39- let nc = nats:: connect ( & self . config . url ) . map_err ( |e| {
40- Box :: new ( std:: io:: Error :: other ( e) ) as Box < dyn std:: error:: Error + Send >
41- } ) ?;
39+ let nc = nats:: connect ( & self . config . url )
40+ . map_err ( |e| Box :: new ( std:: io:: Error :: other ( e) ) as Box < dyn std:: error:: Error + Send > ) ?;
4241
4342 let sub = if let Some ( q) = & self . config . queue_group {
4443 nc. queue_subscribe ( & self . config . subject , q) . map_err ( |e| {
Original file line number Diff line number Diff line change @@ -35,9 +35,8 @@ impl OutputProtocol for NatsOutputProtocol {
3535 }
3636
3737 fn init ( & self ) -> Result < ( ) , Box < dyn std:: error:: Error + Send > > {
38- let nc = nats:: connect ( & self . config . url ) . map_err ( |e| {
39- Box :: new ( std:: io:: Error :: other ( e) ) as Box < dyn std:: error:: Error + Send >
40- } ) ?;
38+ let nc = nats:: connect ( & self . config . url )
39+ . map_err ( |e| Box :: new ( std:: io:: Error :: other ( e) ) as Box < dyn std:: error:: Error + Send > ) ?;
4140 * self . connection . lock ( ) . unwrap ( ) = Some ( nc) ;
4241 Ok ( ( ) )
4342 }
@@ -49,8 +48,9 @@ impl OutputProtocol for NatsOutputProtocol {
4948 Box :: new ( std:: io:: Error :: other ( "NATS connection not initialized" ) )
5049 as Box < dyn std:: error:: Error + Send >
5150 } ) ?;
52- nc. publish ( & self . config . subject , & payload)
53- . map_err ( |e| Box :: new ( std:: io:: Error :: other ( e) ) as Box < dyn std:: error:: Error + Send > ) ?;
51+ nc. publish ( & self . config . subject , & payload) . map_err ( |e| {
52+ Box :: new ( std:: io:: Error :: other ( e) ) as Box < dyn std:: error:: Error + Send >
53+ } ) ?;
5454 }
5555 Ok ( ( ) )
5656 }
You can’t perform that action at this time.
0 commit comments