|
1 | 1 | use { |
2 | 2 | crate::{ |
3 | 3 | api::{ |
4 | | - rest::{ |
5 | | - validate_price_ids, |
6 | | - RestError, |
7 | | - }, |
| 4 | + rest::{validate_price_ids, RestError}, |
8 | 5 | types::{ |
9 | | - BinaryUpdate, |
10 | | - EncodingType, |
11 | | - ParsedPriceUpdate, |
12 | | - PriceIdInput, |
13 | | - PriceUpdate, |
| 6 | + BinaryUpdate, EncodingType, ParsedPriceUpdate, PriceIdInput, PriceUpdate, |
14 | 7 | RpcPriceIdentifier, |
15 | 8 | }, |
16 | 9 | ApiState, |
17 | 10 | }, |
18 | | - state::aggregate::{ |
19 | | - Aggregates, |
20 | | - AggregationEvent, |
21 | | - RequestTime, |
22 | | - }, |
| 11 | + state::aggregate::{Aggregates, AggregationEvent, RequestTime}, |
23 | 12 | }, |
24 | 13 | anyhow::Result, |
25 | 14 | axum::{ |
26 | 15 | extract::State, |
27 | | - response::sse::{ |
28 | | - Event, |
29 | | - KeepAlive, |
30 | | - Sse, |
31 | | - }, |
| 16 | + response::sse::{Event, KeepAlive, Sse}, |
32 | 17 | }, |
33 | 18 | futures::Stream, |
34 | 19 | pyth_sdk::PriceIdentifier, |
35 | 20 | serde::Deserialize, |
36 | 21 | serde_qs::axum::QsQuery, |
37 | 22 | std::convert::Infallible, |
38 | 23 | tokio::sync::broadcast, |
39 | | - tokio_stream::{ |
40 | | - wrappers::BroadcastStream, |
41 | | - StreamExt as _, |
42 | | - }, |
| 24 | + tokio_stream::{wrappers::BroadcastStream, StreamExt as _}, |
43 | 25 | utoipa::IntoParams, |
44 | 26 | }; |
45 | 27 |
|
@@ -74,7 +56,8 @@ pub struct StreamPriceUpdatesQueryParams { |
74 | 56 | #[serde(default)] |
75 | 57 | benchmarks_only: bool, |
76 | 58 |
|
77 | | - /// If true, invalid price IDs in the `ids` parameter are ignored. Only applicable to the v2 APIs. Default is `false`. #[serde(default)] |
| 59 | + /// If true, invalid price IDs in the `ids` parameter are ignored. Only applicable to the v2 APIs. Default is `false`. |
| 60 | + #[serde(default)] |
78 | 61 | ignore_invalid_price_ids: bool, |
79 | 62 | } |
80 | 63 |
|
@@ -179,7 +162,6 @@ where |
179 | 162 | .map(|price_feed| price_feed.into()) |
180 | 163 | .collect(); |
181 | 164 |
|
182 | | - |
183 | 165 | if benchmarks_only { |
184 | 166 | // Remove those with metadata.prev_publish_time != price.publish_time from parsed_price_updates |
185 | 167 | parsed_price_updates.retain(|price_feed| { |
|
0 commit comments