diff --git a/Cargo.lock b/Cargo.lock index e6759c0..dbbae59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -794,11 +794,11 @@ dependencies = [ [[package]] name = "kon" -version = "0.1.5" +version = "0.1.6" dependencies = [ "cargo_toml", "gamedig", - "lazy_static", + "once_cell", "poise", "reqwest", "serde_json", @@ -951,9 +951,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" diff --git a/Cargo.toml b/Cargo.toml index a7eb5d4..cb632e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kon" -version = "0.1.5" +version = "0.1.6" rust-version = "1.74" edition = "2021" @@ -9,7 +9,7 @@ edition = "2021" [dependencies] cargo_toml = "0.17.2" gamedig = "0.4.1" -lazy_static = "1.4.0" +once_cell = "1.19.0" poise = "0.5.7" reqwest = "0.11.23" serde_json = "1.0.109" diff --git a/src/commands/status.rs b/src/commands/status.rs index c8dfc35..1ebf174 100644 --- a/src/commands/status.rs +++ b/src/commands/status.rs @@ -18,13 +18,14 @@ use reqwest::{ Client, header::USER_AGENT }; +use once_cell::sync::Lazy; use cargo_toml::Manifest; use serde_json::Value; use tokio::join; -lazy_static::lazy_static! { - static ref PMS_BASE: String = var("WG_PMS").expect("Expected a \"WG_PMS\" in the envvar but none was found"); -} +static PMS_BASE: Lazy = Lazy::new(|| + var("WG_PMS").expect("Expected a \"WG_PMS\" in the envvar but none was found") +); fn query_server() -> Result { let server_ip = var("ATS_SERVER_IP").expect("Expected a \"ATS_SERVER_IP\" in the envvar but none was found");