Skip to content

Commit 7dc52ef

Browse files
style: fix formatting and clippy lints
Co-Authored-By: Tejas Badadare <[email protected]>
1 parent 5c74f20 commit 7dc52ef

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

lazer/sdk/rust/consumer/examples/basic.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use {
33
pyth_lazer_consumer::{
44
Chain, DeliveryFormat, PriceFeedId, PriceFeedProperty, PythLazerConsumer, Response,
55
},
6-
tokio,
76
};
87

98
#[tokio::main]
@@ -31,21 +30,18 @@ async fn main() -> Result<()> {
3130
// Receive updates
3231
let mut rx = consumer.subscribe_to_updates();
3332
while let Ok(update) = rx.recv().await {
34-
match update {
35-
Response::StreamUpdated(update) => {
36-
println!(
37-
"Received update for subscription {}",
38-
update.subscription_id.0
39-
);
40-
if let Some(parsed) = update.payload.parsed {
41-
for feed in parsed.price_feeds {
42-
println!(" Feed ID: {:?}", feed.price_feed_id);
43-
println!(" Price: {:?}", feed.price);
44-
println!(" Exponent: {:?}", feed.exponent);
45-
}
33+
if let Response::StreamUpdated(update) = update {
34+
println!(
35+
"Received update for subscription {}",
36+
update.subscription_id.0
37+
);
38+
if let Some(parsed) = update.payload.parsed {
39+
for feed in parsed.price_feeds {
40+
println!(" Feed ID: {:?}", feed.price_feed_id);
41+
println!(" Price: {:?}", feed.price);
42+
println!(" Exponent: {:?}", feed.exponent);
4643
}
4744
}
48-
_ => {}
4945
}
5046
}
5147

lazer/sdk/rust/consumer/tests/integration_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use {
55
router::{JsonUpdate, PriceFeedId},
66
subscription::{StreamUpdatedResponse, SubscribedResponse, SubscriptionId},
77
},
8-
serde_json,
98
std::{sync::Arc, time::Duration},
109
tokio::sync::Mutex,
1110
tokio_tungstenite::tungstenite::Message,

0 commit comments

Comments
 (0)