From facd6371be4ac48c6fe0dafb976d89053c85114b Mon Sep 17 00:00:00 2001 From: Jan Vanbuel Date: Sun, 8 Dec 2024 09:40:52 +0100 Subject: [PATCH] replace lazy_static with stdlib LazyLock --- Cargo.lock | 1 - Cargo.toml | 1 - src/app.rs | 2 +- src/main.rs | 5 ++--- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b2116d..e45d5dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -599,7 +599,6 @@ dependencies = [ "futures", "indoc", "inquire", - "lazy_static", "left-pad", "log", "mockito", diff --git a/Cargo.toml b/Cargo.toml index dcafa16..3a5f9fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,6 @@ env_logger = "0.11.5" futures = "0.3.31" indoc = "2.0.5" inquire = "0.7.5" -lazy_static = "1.5.0" left-pad = "1.0.1" log = "0.4.22" ratatui = { version = "0.29.0", features = ["unstable-widget-ref"] } diff --git a/src/app.rs b/src/app.rs index e26fedd..82f6424 100644 --- a/src/app.rs +++ b/src/app.rs @@ -34,7 +34,7 @@ pub async fn run_app(terminal: &mut Terminal, app: Arc .servers .as_ref() .and_then(|servers| servers.iter().find(|s| s.name == *server)), - None => None, + _ => None, }; airflow_client = airflow_config.map(AirFlowClient::from); } diff --git a/src/main.rs b/src/main.rs index 88f2f72..31709c0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use std::path::PathBuf; +use std::sync::LazyLock; use clap::Parser; use ui::constants::ASCII_LOGO; @@ -13,9 +14,7 @@ use commands::config::model::ConfigCommand; use commands::run::RunCommand; use dirs::home_dir; -lazy_static::lazy_static! { - pub static ref CONFIG_FILE: PathBuf = home_dir().unwrap().join(".flowrs"); -} +static CONFIG_FILE: LazyLock = LazyLock::new(|| home_dir().unwrap().join(".flowrs")); #[derive(Parser)] #[clap(name="flowrs", bin_name="flowrs", version, about, before_help=ASCII_LOGO)]