Skip to content

Commit a889358

Browse files
committed
update code format
1 parent 8495adc commit a889358

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/runtime/input/protocol/nats/nats_protocol.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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| {

src/runtime/output/protocol/nats/nats_protocol.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)