Skip to content

Commit ffb4def

Browse files
committed
ci3
1 parent bfc8c47 commit ffb4def

File tree

11 files changed

+15
-22
lines changed

11 files changed

+15
-22
lines changed

.github/workflows/ci-lazer-solana-contract.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: actions-rust-lang/setup-rust-toolchain@v1
21-
with:
22-
toolchain: 1.82.0
23-
components: clippy, rustfmt
2421
- name: install taplo
2522
run: cargo install --locked [email protected]
2623
- uses: actions/setup-node@v4

apps/hermes/server/src/api/rest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl IntoResponse for RestError {
7676

7777
(
7878
StatusCode::NOT_FOUND,
79-
format!("Price ids not found: {}", missing_ids),
79+
format!("Price ids not found: {missing_ids}"),
8080
)
8181
.into_response()
8282
}

apps/hermes/server/src/api/rest/v2/price_feeds_metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ where
5454
.map_err(|e| {
5555
tracing::warn!("RPC connection error: {}", e);
5656
RestError::RpcConnectionError {
57-
message: format!("RPC connection error: {}", e),
57+
message: format!("RPC connection error: {e}"),
5858
}
5959
})?;
6060

apps/hermes/server/src/api/rest/v2/sse.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,7 @@ where
185185
price_feed
186186
.metadata
187187
.prev_publish_time
188-
.map_or(false, |prev_time| {
189-
prev_time != price_feed.price.publish_time
190-
})
188+
.is_some_and(|prev_time| prev_time != price_feed.price.publish_time)
191189
});
192190
// Retain price id in price_ids that are in parsed_price_updates
193191
price_ids.retain(|price_id| {
@@ -231,5 +229,5 @@ where
231229
fn error_event<E: std::fmt::Debug>(e: E) -> Event {
232230
Event::default()
233231
.event("error")
234-
.data(format!("Error receiving update: {:?}", e))
232+
.data(format!("Error receiving update: {e:?}"))
235233
}

apps/hermes/server/src/api/ws.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,7 @@ where
579579
serde_json::to_string(&ServerMessage::Response(
580580
ServerResponseMessage::Err {
581581
error: format!(
582-
"Price feed(s) with id(s) {:?} not found",
583-
not_found_price_ids
582+
"Price feed(s) with id(s) {not_found_price_ids:?} not found",
584583
),
585584
},
586585
))?

apps/hermes/server/src/state/aggregate/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl Metrics {
7979
let order = if self
8080
.newest_observed_slot
8181
.get(&event)
82-
.map_or(true, |&observed_slot| slot > observed_slot)
82+
.is_none_or(|&observed_slot| slot > observed_slot)
8383
{
8484
self.newest_observed_slot.insert(event.clone(), slot);
8585
SlotOrder::New

apps/hermes/server/src/state/benchmarks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ where
8888
.endpoint
8989
.as_ref()
9090
.ok_or_else(|| anyhow::anyhow!("Benchmarks endpoint is not set"))?
91-
.join(&format!("/v1/updates/price/{}", publish_time))
91+
.join(&format!("/v1/updates/price/{publish_time}"))
9292
.context("failed to construct price endpoint")?;
9393

9494
let mut request = reqwest::Client::new()

apps/hermes/server/src/state/cache.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ where
183183

184184
// Sometimes, some keys are removed from the accumulator. We track which keys are not
185185
// present in the message states and remove them from the cache.
186-
let keys_in_cache = message_cache
187-
.iter()
188-
.map(|(key, _)| key.clone())
189-
.collect::<HashSet<_>>();
186+
let keys_in_cache = message_cache.keys().cloned().collect::<HashSet<_>>();
190187

191188
for key in keys_in_cache {
192189
if !current_keys.contains(&key) {

apps/hermes/server/src/state/price_feeds_metadata.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ where
7373
// Filter by query if provided
7474
if let Some(query_str) = &query {
7575
price_feeds_metadata.retain(|feed| {
76-
feed.attributes.get("symbol").map_or(false, |symbol| {
77-
symbol.to_lowercase().contains(&query_str.to_lowercase())
78-
})
76+
feed.attributes
77+
.get("symbol")
78+
.is_some_and(|symbol| symbol.to_lowercase().contains(&query_str.to_lowercase()))
7979
});
8080
}
8181

8282
// Filter by asset_type if provided
8383
if let Some(asset_type) = &asset_type {
8484
price_feeds_metadata.retain(|feed| {
85-
feed.attributes.get("asset_type").map_or(false, |type_str| {
85+
feed.attributes.get("asset_type").is_some_and(|type_str| {
8686
type_str.to_lowercase().trim().replace(" ", "_")
8787
== asset_type.to_string().to_lowercase()
8888
})

lazer/contracts/solana/clippy.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
allow-unwrap-in-tests = true
2+
allow-expect-in-tests = true
3+
#allow-indexing-slicing-in-tests = true

0 commit comments

Comments
 (0)