Skip to content

Commit

Permalink
Merge pull request #277 from jvanbuel/feature/stdlib-instead-of-lazy-…
Browse files Browse the repository at this point in the history
…static

replace lazy_static with stdlib LazyLock
  • Loading branch information
jvanbuel authored Dec 8, 2024
2 parents 360eaf0 + facd637 commit f1b62d1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub async fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: Arc<Mutex<App>
.servers
.as_ref()
.and_then(|servers| servers.iter().find(|s| s.name == *server)),
None => None,
_ => None,
};
airflow_client = airflow_config.map(AirFlowClient::from);
}
Expand Down
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::path::PathBuf;
use std::sync::LazyLock;

use clap::Parser;
use ui::constants::ASCII_LOGO;
Expand All @@ -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<PathBuf> = LazyLock::new(|| home_dir().unwrap().join(".flowrs"));

#[derive(Parser)]
#[clap(name="flowrs", bin_name="flowrs", version, about, before_help=ASCII_LOGO)]
Expand Down

0 comments on commit f1b62d1

Please sign in to comment.