Skip to content

Commit 53f67d9

Browse files
committed
fix formatting
1 parent e315e4e commit 53f67d9

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

apps/pyth-lazer-agent/src/publisher_handle.rs

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,17 @@ async fn try_handle_publisher(
8585
&receive_buf,
8686
bincode::config::legacy(),
8787
) {
88-
Ok((data, _)) => {
89-
FeedUpdate {
90-
feed_id: Some(data.price_feed_id.0),
91-
source_timestamp: MessageField::some(data.source_timestamp_us.into()),
92-
update: Some(Update::PriceUpdate(PriceUpdate {
93-
price: data.price.map(|p| p.0.get()),
94-
best_bid_price: data.best_bid_price.map(|p| p.0.get()),
95-
best_ask_price: data.best_ask_price.map(|p| p.0.get()),
96-
..PriceUpdate::default()
97-
})),
98-
special_fields: Default::default(),
99-
}
100-
}
88+
Ok((data, _)) => FeedUpdate {
89+
feed_id: Some(data.price_feed_id.0),
90+
source_timestamp: MessageField::some(data.source_timestamp_us.into()),
91+
update: Some(Update::PriceUpdate(PriceUpdate {
92+
price: data.price.map(|p| p.0.get()),
93+
best_bid_price: data.best_bid_price.map(|p| p.0.get()),
94+
best_ask_price: data.best_ask_price.map(|p| p.0.get()),
95+
..PriceUpdate::default()
96+
})),
97+
special_fields: Default::default(),
98+
},
10199
Err(err) => {
102100
error_count += 1;
103101
if error_count <= MAX_ERROR_LOG {
@@ -123,18 +121,16 @@ async fn try_handle_publisher(
123121
&receive_buf,
124122
bincode::config::legacy(),
125123
) {
126-
Ok((data, _)) => {
127-
FeedUpdate {
128-
feed_id: Some(data.price_feed_id.0),
129-
source_timestamp: MessageField::some(data.source_timestamp_us.into()),
130-
update: Some(Update::FundingRateUpdate(FundingRateUpdate {
131-
price: data.price.map(|p| p.0.get()),
132-
rate: data.funding_rate.map(|r| r.0),
133-
..FundingRateUpdate::default()
134-
})),
135-
special_fields: Default::default(),
136-
}
137-
}
124+
Ok((data, _)) => FeedUpdate {
125+
feed_id: Some(data.price_feed_id.0),
126+
source_timestamp: MessageField::some(data.source_timestamp_us.into()),
127+
update: Some(Update::FundingRateUpdate(FundingRateUpdate {
128+
price: data.price.map(|p| p.0.get()),
129+
rate: data.funding_rate.map(|r| r.0),
130+
..FundingRateUpdate::default()
131+
})),
132+
special_fields: Default::default(),
133+
},
138134
Err(err) => {
139135
error_count += 1;
140136
if error_count <= MAX_ERROR_LOG {

apps/pyth-lazer-agent/src/websocket_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub async fn send_text<T: AsyncRead + AsyncWrite + Unpin>(
4444

4545
pub async fn send_json<T: AsyncRead + AsyncWrite + Unpin, U: serde::Serialize>(
4646
sender: &mut Sender<T>,
47-
value: &U
47+
value: &U,
4848
) -> anyhow::Result<()> {
4949
send_text(sender, &serde_json::to_string(value)?).await
5050
}

0 commit comments

Comments
 (0)