diff --git a/Cargo.lock b/Cargo.lock index d0a1fe2..8f12880 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -126,7 +126,6 @@ dependencies = [ "env_logger", "exitcode", "home-config", - "lazy_static", "log", "regex", "reqwest", @@ -891,12 +890,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.183" diff --git a/Cargo.toml b/Cargo.toml index b982ed1..d26a639 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,6 @@ tabled = "0.20.0" thiserror = "2.0.18" thousands = "0.2.0" typetag = "0.2" -lazy_static = "1.5.0" [dev-dependencies] assert_cmd = "2.1.2" diff --git a/src/currency/fiat.rs b/src/currency/fiat.rs index 4564b90..7c758da 100644 --- a/src/currency/fiat.rs +++ b/src/currency/fiat.rs @@ -1,20 +1,20 @@ use crate::fiat_rates::blockchain_info_consumer; -use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; -use std::sync::Mutex; +use std::sync::{LazyLock, Mutex}; use strum_macros::{Display, EnumString}; use crate::currency::Currency; use crate::fiat_rates::exchange_rate_provider::ExchangeRateProvider; // Static to have an easy way of caching the exchange rates. -lazy_static! { - static ref EXCHANGE_RATE_PROVIDER: Mutex> = - Mutex::new(ExchangeRateProvider { - data_source: blockchain_info_consumer::ApiConsumer, - data: None, - }); -} +static EXCHANGE_RATE_PROVIDER: LazyLock< + Mutex>, +> = LazyLock::new(|| { + Mutex::new(ExchangeRateProvider { + data_source: blockchain_info_consumer::ApiConsumer, + data: None, + }) +}); #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, EnumString, Display)] #[strum(ascii_case_insensitive, serialize_all = "UPPERCASE")]