From 02073a6603c13caf1e142327ca63fefe9328c9a9 Mon Sep 17 00:00:00 2001 From: Tejas Badadare Date: Wed, 6 Nov 2024 13:49:57 -0800 Subject: [PATCH] chore(hermes): use stable rust toolchain in precommit formatter (#2103) * chore(hermes): formatting * chore(hermes): use stable rust toolchain in precommit formatter --- .pre-commit-config.yaml | 2 +- apps/hermes/server/src/api/rest/v2/sse.rs | 28 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29b8e9a3d6..c1965502d3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -78,7 +78,7 @@ repos: - id: cargo-fmt-fortuna name: Cargo format for Fortuna language: "rust" - entry: cargo +nightly-2023-07-23 fmt --manifest-path ./apps/fortuna/Cargo.toml --all -- --config-path rustfmt.toml + entry: cargo +1.82.0 fmt --manifest-path ./apps/fortuna/Cargo.toml --all -- --config-path rustfmt.toml pass_filenames: false files: apps/fortuna - id: cargo-clippy-fortuna diff --git a/apps/hermes/server/src/api/rest/v2/sse.rs b/apps/hermes/server/src/api/rest/v2/sse.rs index 70c5766870..8e741855fd 100644 --- a/apps/hermes/server/src/api/rest/v2/sse.rs +++ b/apps/hermes/server/src/api/rest/v2/sse.rs @@ -1,19 +1,34 @@ use { crate::{ api::{ - rest::{validate_price_ids, RestError}, + rest::{ + validate_price_ids, + RestError, + }, types::{ - BinaryUpdate, EncodingType, ParsedPriceUpdate, PriceIdInput, PriceUpdate, + BinaryUpdate, + EncodingType, + ParsedPriceUpdate, + PriceIdInput, + PriceUpdate, RpcPriceIdentifier, }, ApiState, }, - state::aggregate::{Aggregates, AggregationEvent, RequestTime}, + state::aggregate::{ + Aggregates, + AggregationEvent, + RequestTime, + }, }, anyhow::Result, axum::{ extract::State, - response::sse::{Event, KeepAlive, Sse}, + response::sse::{ + Event, + KeepAlive, + Sse, + }, }, futures::Stream, pyth_sdk::PriceIdentifier, @@ -21,7 +36,10 @@ use { serde_qs::axum::QsQuery, std::convert::Infallible, tokio::sync::broadcast, - tokio_stream::{wrappers::BroadcastStream, StreamExt as _}, + tokio_stream::{ + wrappers::BroadcastStream, + StreamExt as _, + }, utoipa::IntoParams, };