typed Syntax and improved formatting

This commit is contained in:
2026-07-25 04:30:58 +02:00
parent 6b6085ef25
commit f615d8dfbb
7 changed files with 147 additions and 87 deletions
+7 -4
View File
@@ -1,6 +1,9 @@
use std::collections::HashMap;
use pulse_wire::terminal::MarketItem;
use pulse_wire::{
terminal::MarketItem,
units::{Symbol, USD},
};
use serde_json::Value;
fn number(value: &Value, field: &str) -> Result<f64, String> {
@@ -64,10 +67,10 @@ pub async fn fetch_watch_list(
by_symbol.insert(
symbol,
MarketItem {
symbol: symbol.to_owned(),
price,
symbol: Symbol(symbol.to_owned()),
price: USD(price),
volume_24h: USD(volume_24h),
trend: ((price / previous_day_price) - 1.0) * 100.0,
volume_24h,
},
);
}