#[cfg(feature = "crypto")]
fn main() {
use finance_query::CryptoQuote;
let quote: CryptoQuote = serde_json::from_value(serde_json::json!({
"id": "BTC",
"symbol": "BTC",
"name": "Bitcoin",
"price": 67234.50,
"market_cap": 1_325_000_000_000.0,
"volume_24h": 28_400_000_000.0,
"change_24h": 1540.20,
"change_percent_24h": 2.35,
"high_24h": 67800.0,
"low_24h": 65500.0,
"circulating_supply": 19_700_000.0,
}))
.unwrap();
fn verify_crypto_quote_price(q: CryptoQuote) {
let _: Option<f64> = q.price;
}
verify_crypto_quote_price(quote.clone());
println!("symbol = {}", quote.symbol);
println!("price = {:?}", quote.price);
}
#[cfg(not(feature = "crypto"))]
fn main() {}