diff --git a/.dprint.json b/.dprint.json index 0e481f7fa..c08d7c0e5 100644 --- a/.dprint.json +++ b/.dprint.json @@ -28,6 +28,6 @@ "https://github.com/dprint/dprint-plugin-typescript/releases/download/0.93.0/plugin.wasm", "https://github.com/dprint/dprint-plugin-json/releases/download/0.19.3/plugin.wasm", "https://github.com/dprint/dprint-plugin-markdown/releases/download/0.17.8/plugin.wasm", - "https://github.com/dprint/dprint-plugin-toml/releases/download/0.6.2/plugin.wasm" + "https://github.com/dprint/dprint-plugin-toml/releases/download/0.6.3/plugin.wasm" ] } diff --git a/Cargo.lock b/Cargo.lock index 4a3b88eb3..125d1f202 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2762,7 +2762,6 @@ dependencies = [ "nix", "notify-rust", "nu-ansi-term", - "once_cell", "open", "os_info", "path-slash", diff --git a/Cargo.toml b/Cargo.toml index 3e10358ab..fc22fa193 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ license = "ISC" readme = "README.md" repository = "https://github.com/starship/starship" # Note: MSRV is only intended as a hint, and only the latest version is officially supported in starship. -rust-version = "1.76" +rust-version = "1.80" description = """ The minimal, blazing-fast, and infinitely customizable prompt for any shell! ☄🌌️ """ @@ -56,7 +56,6 @@ log = { version = "0.4.22", features = ["std"] } # see: https://github.com/NixOS/nixpkgs/issues/160876 notify-rust = { version = "4.11.3", optional = true } nu-ansi-term = "0.50.1" -once_cell = "1.20.2" open = "5.3.0" # update os module config and tests when upgrading os_info os_info = "3.8.2" diff --git a/deny.toml b/deny.toml index 341067349..a22f0cc88 100644 --- a/deny.toml +++ b/deny.toml @@ -4,8 +4,6 @@ version = 2 # A list of advisory IDs to ignore. Note that ignored advisories will still # output a note when they are encountered. ignore = [ - - # { id = "RUSTSEC-0000-0000", reason = "" }, ] diff --git a/src/context.rs b/src/context.rs index f00e675d5..dd27bfe6e 100644 --- a/src/context.rs +++ b/src/context.rs @@ -12,7 +12,6 @@ use gix::{ sec::{self as git_sec, trust::DefaultForLevel}, state as git_state, Repository, ThreadSafeRepository, }; -use once_cell::sync::OnceCell; #[cfg(test)] use std::collections::HashMap; use std::collections::HashSet; @@ -25,6 +24,7 @@ use std::num::ParseIntError; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::string::String; +use std::sync::OnceLock; use std::time::{Duration, Instant}; use terminal_size::terminal_size; @@ -44,13 +44,13 @@ pub struct Context<'a> { pub logical_dir: PathBuf, /// A struct containing directory contents in a lookup-optimized format. - dir_contents: OnceCell, + dir_contents: OnceLock>, /// Properties to provide to modules. pub properties: Properties, /// Private field to store Git information for modules who need it - repo: OnceCell, + repo: OnceLock>>, /// The shell the user is assumed to be running pub shell: Shell, @@ -166,8 +166,8 @@ impl<'a> Context<'a> { properties, current_dir, logical_dir, - dir_contents: OnceCell::new(), - repo: OnceCell::new(), + dir_contents: OnceLock::new(), + repo: OnceLock::new(), shell, target, width, @@ -286,9 +286,9 @@ impl<'a> Context<'a> { } /// Will lazily get repo root and branch when a module requests it. - pub fn get_repo(&self) -> Result<&Repo, Box> { + pub fn get_repo(&self) -> Result<&Repo, &gix::discover::Error> { self.repo - .get_or_try_init(|| -> Result> { + .get_or_init(|| -> Result> { // custom open options let mut git_open_opts_map = git_sec::trust::Mapping::::default(); @@ -359,17 +359,21 @@ impl<'a> Context<'a> { kind: repository.kind(), }) }) + .as_ref() + .map_err(std::convert::AsRef::as_ref) } - pub fn dir_contents(&self) -> Result<&DirContents, std::io::Error> { - self.dir_contents.get_or_try_init(|| { - let timeout = self.root_config.scan_timeout; - DirContents::from_path_with_timeout( - &self.current_dir, - Duration::from_millis(timeout), - self.root_config.follow_symlinks, - ) - }) + pub fn dir_contents(&self) -> Result<&DirContents, &std::io::Error> { + self.dir_contents + .get_or_init(|| { + let timeout = self.root_config.scan_timeout; + DirContents::from_path_with_timeout( + &self.current_dir, + Duration::from_millis(timeout), + self.root_config.follow_symlinks, + ) + }) + .as_ref() } fn get_shell() -> Shell { diff --git a/src/formatter/string_formatter.rs b/src/formatter/string_formatter.rs index a232210c5..f40182ab6 100644 --- a/src/formatter/string_formatter.rs +++ b/src/formatter/string_formatter.rs @@ -303,10 +303,6 @@ impl<'a> StringFormatter<'a> { ), )), FormatElement::TextGroup(textgroup) => { - let textgroup = TextGroup { - format: textgroup.format, - style: textgroup.style, - }; parse_textgroup(textgroup, variables, style_variables, context) } FormatElement::Variable(name) => variables diff --git a/src/formatter/version.rs b/src/formatter/version.rs index dde5fe3ee..3cd18e10e 100644 --- a/src/formatter/version.rs +++ b/src/formatter/version.rs @@ -1,8 +1,8 @@ use super::string_formatter::StringFormatterError; use super::StringFormatter; use crate::segment; -use once_cell::sync::Lazy; use std::ops::Deref; +use std::sync::LazyLock; use versions::Versioning; pub struct VersionFormatter<'a> { @@ -30,7 +30,7 @@ impl<'a> VersionFormatter<'a> { /// Formats a version structure into a readable string pub fn format(self, version: &'a str) -> Result { - let parsed = Lazy::new(|| Versioning::new(version)); + let parsed = LazyLock::new(|| Versioning::new(version)); let formatted = self .formatter .map(|variable| match variable { diff --git a/src/logger.rs b/src/logger.rs index da22bfcc4..c5521cf45 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -1,7 +1,7 @@ use crate::utils; use log::{Level, LevelFilter, Metadata, Record}; use nu_ansi_term::Color; -use once_cell::sync::OnceCell; +use std::sync::OnceLock; use std::{ cmp, collections::HashSet, @@ -13,7 +13,7 @@ use std::{ }; pub struct StarshipLogger { - log_file: OnceCell>, + log_file: OnceLock, std::io::Error>>, log_file_path: PathBuf, log_file_content: RwLock>, log_level: Level, @@ -101,7 +101,7 @@ impl Default for StarshipLogger { .map(std::string::ToString::to_string) .collect(), ), - log_file: OnceCell::new(), + log_file: OnceLock::new(), log_file_path: session_log_file, log_level: env::var("STARSHIP_LOG") .map(|level| match level.to_ascii_lowercase().as_str() { @@ -174,7 +174,7 @@ impl log::Log for StarshipLogger { // Write warning messages to the log file // If log level is error, only write error messages to the log file if record.level() <= cmp::min(Level::Warn, self.log_level) { - let log_file = match self.log_file.get_or_try_init(|| { + let log_file = match self.log_file.get_or_init(|| { OpenOptions::new() .create(true) .append(true) @@ -224,7 +224,7 @@ impl log::Log for StarshipLogger { } fn flush(&self) { - if let Some(m) = self.log_file.get() { + if let Some(Ok(m)) = self.log_file.get() { let result = match m.lock() { Ok(mut file) => file.flush(), Err(err) => return eprintln!("Log file writer mutex was poisoned: {err:?}"), @@ -246,7 +246,9 @@ mod test { use super::*; use crate::utils::read_file; use log::Log; + use std::fs::{File, FileTimes}; use std::io; + use std::time::SystemTime; #[test] fn test_log_to_file() -> io::Result<()> { @@ -353,11 +355,7 @@ mod test { } #[test] - #[cfg(unix)] fn test_cleanup() -> io::Result<()> { - use nix::sys::{stat::utimes, time::TimeVal}; - use std::fs::File; - let log_dir = tempfile::tempdir()?; // Should not be deleted @@ -379,6 +377,10 @@ mod test { } fs::create_dir(&directory)?; + let times = FileTimes::new() + .set_accessed(SystemTime::UNIX_EPOCH) + .set_modified(SystemTime::UNIX_EPOCH); + // Set all files except the new file to be older than 24 hours for file in &[ &non_matching_file, @@ -386,10 +388,19 @@ mod test { &old_file, &directory, ] { - utimes(file.as_path(), &TimeVal::new(0, 0), &TimeVal::new(0, 0))?; - if let Ok(f) = File::open(file) { - f.sync_all()?; - } + let Ok(f) = File::open(file) else { + panic!("Unable to open file {file:?}!") + }; + + match f.set_times(times) { + Err(err) if err.kind() == io::ErrorKind::PermissionDenied => { + // Ignore permission errors (e.g. on Windows) + eprintln!("Unable to set file times for {file:?}: {err:?}"); + return Ok(()); + } + other => other, + }?; + f.sync_all()?; } cleanup_log_files(log_dir.path()); diff --git a/src/modules/aws.rs b/src/modules/aws.rs index c5a3a6f9c..8d4d753ca 100644 --- a/src/modules/aws.rs +++ b/src/modules/aws.rs @@ -4,7 +4,7 @@ use std::str::FromStr; use chrono::DateTime; use ini::Ini; -use once_cell::unsync::OnceCell; +use std::cell::OnceCell; use super::{Context, Module, ModuleConfig}; diff --git a/src/modules/c.rs b/src/modules/c.rs index 3e520f4dc..94cc8a78a 100644 --- a/src/modules/c.rs +++ b/src/modules/c.rs @@ -4,10 +4,10 @@ use crate::configs::c::CConfig; use crate::formatter::StringFormatter; use crate::formatter::VersionFormatter; -use once_cell::sync::Lazy; use semver::Version; use std::borrow::Cow; use std::ops::Deref; +use std::sync::LazyLock; /// Creates a module with the current C compiler and version pub fn module<'a>(context: &'a Context) -> Option> { @@ -25,7 +25,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { } let parsed = StringFormatter::new(config.format).and_then(|formatter| { - let c_compiler_info = Lazy::new(|| context.exec_cmds_return_first(config.commands)); + let c_compiler_info = LazyLock::new(|| context.exec_cmds_return_first(config.commands)); formatter .map_meta(|var, _| match var { diff --git a/src/modules/dotnet.rs b/src/modules/dotnet.rs index a5ace0a13..8bb829ae4 100644 --- a/src/modules/dotnet.rs +++ b/src/modules/dotnet.rs @@ -254,7 +254,7 @@ fn get_pinned_sdk_version(json: &str) -> Option { } } -fn get_local_dotnet_files(context: &Context) -> Result, std::io::Error> { +fn get_local_dotnet_files<'a>(context: &'a Context) -> Result, &'a std::io::Error> { Ok(context .dir_contents()? .files() diff --git a/src/modules/elixir.rs b/src/modules/elixir.rs index 8fb7ccdd7..00066bd3b 100644 --- a/src/modules/elixir.rs +++ b/src/modules/elixir.rs @@ -4,8 +4,8 @@ use crate::configs::elixir::ElixirConfig; use crate::formatter::StringFormatter; use crate::formatter::VersionFormatter; -use once_cell::sync::Lazy; use std::ops::Deref; +use std::sync::LazyLock; /// Create a module with the current Elixir version pub fn module<'a>(context: &'a Context) -> Option> { @@ -23,7 +23,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { return None; } - let versions = Lazy::new(|| get_elixir_version(context)); + let versions = LazyLock::new(|| get_elixir_version(context)); let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter diff --git a/src/modules/gcloud.rs b/src/modules/gcloud.rs index 932d4c06b..5e985cd3b 100644 --- a/src/modules/gcloud.rs +++ b/src/modules/gcloud.rs @@ -1,8 +1,8 @@ use ini::Ini; -use once_cell::sync::{Lazy, OnceCell}; use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; +use std::sync::{LazyLock, OnceLock}; use super::{Context, Module, ModuleConfig}; @@ -15,7 +15,7 @@ type Account<'a> = (&'a str, Option<&'a str>); struct GcloudContext { config_name: String, config_path: PathBuf, - config: OnceCell>, + config: OnceLock>, } impl<'a> GcloudContext { @@ -94,7 +94,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { return None; } let gcloud_context = GcloudContext::new(&config_name, &config_path); - let account: Lazy>, _> = Lazy::new(|| gcloud_context.get_account()); + let account: LazyLock>, _> = LazyLock::new(|| gcloud_context.get_account()); let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter diff --git a/src/modules/git_status.rs b/src/modules/git_status.rs index c71f1d2b4..4e8f44ddb 100644 --- a/src/modules/git_status.rs +++ b/src/modules/git_status.rs @@ -1,5 +1,5 @@ -use once_cell::sync::OnceCell; use regex::Regex; +use std::sync::OnceLock; use super::{Context, Module, ModuleConfig}; @@ -135,8 +135,8 @@ struct GitStatusInfo<'a> { context: &'a Context<'a>, repo: &'a context::Repo, config: GitStatusConfig<'a>, - repo_status: OnceCell>, - stashed_count: OnceCell>, + repo_status: OnceLock>, + stashed_count: OnceLock>, } impl<'a> GitStatusInfo<'a> { @@ -149,8 +149,8 @@ impl<'a> GitStatusInfo<'a> { context, repo, config, - repo_status: OnceCell::new(), - stashed_count: OnceCell::new(), + repo_status: OnceLock::new(), + stashed_count: OnceLock::new(), } } diff --git a/src/modules/golang.rs b/src/modules/golang.rs index ee0f5095c..14069f4ca 100644 --- a/src/modules/golang.rs +++ b/src/modules/golang.rs @@ -4,11 +4,11 @@ use crate::configs::go::GoConfig; use crate::formatter::StringFormatter; use crate::formatter::VersionFormatter; -use once_cell::sync::Lazy; use regex::Regex; use semver::Version; use semver::VersionReq; use std::ops::Deref; +use std::sync::LazyLock; /// Creates a module with the current Go version pub fn module<'a>(context: &'a Context) -> Option> { @@ -26,8 +26,8 @@ pub fn module<'a>(context: &'a Context) -> Option> { } let golang_version = - Lazy::new(|| parse_go_version(&context.exec_cmd("go", &["version"])?.stdout)); - let mod_version = Lazy::new(|| get_go_mod_version(context)); + LazyLock::new(|| parse_go_version(&context.exec_cmd("go", &["version"])?.stdout)); + let mod_version = LazyLock::new(|| get_go_mod_version(context)); let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter diff --git a/src/modules/hostname.rs b/src/modules/hostname.rs index c5392573d..669cc1890 100644 --- a/src/modules/hostname.rs +++ b/src/modules/hostname.rs @@ -270,10 +270,7 @@ mod tests { toml_config["hostname"]["aliases"] .as_table_mut() .unwrap() - .insert( - hostname.clone(), - toml::Value::String("homeworld".to_string()), - ); + .insert(hostname, toml::Value::String("homeworld".to_string())); let actual = ModuleRenderer::new("hostname") .config(toml_config) .collect(); diff --git a/src/modules/mojo.rs b/src/modules/mojo.rs index 9627bf9a7..7107970f8 100644 --- a/src/modules/mojo.rs +++ b/src/modules/mojo.rs @@ -3,8 +3,7 @@ use super::{Context, Module, ModuleConfig}; use crate::configs::mojo::MojoConfig; use crate::formatter::StringFormatter; -use once_cell::sync::Lazy; -use std::ops::Deref; +use std::sync::LazyLock; /// Creates a module with the current Mojo version pub fn module<'a>(context: &'a Context) -> Option> { @@ -22,7 +21,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { return None; } - let version_hash = Lazy::new(|| get_mojo_version(context)); + let version_hash = LazyLock::new(|| get_mojo_version(context)); let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter @@ -35,11 +34,11 @@ pub fn module<'a>(context: &'a Context) -> Option> { _ => None, }) .map(|variable| match variable { - "version" => match version_hash.deref() { + "version" => match &*version_hash { Some((version, _)) => Some(Ok(version)), _ => None, }, - "hash" => match version_hash.deref() { + "hash" => match &*version_hash { Some((_, Some(hash))) => Some(Ok(hash)), _ => None, }, diff --git a/src/modules/nodejs.rs b/src/modules/nodejs.rs index bf319fcfd..614588685 100644 --- a/src/modules/nodejs.rs +++ b/src/modules/nodejs.rs @@ -3,12 +3,12 @@ use super::{Context, Module, ModuleConfig}; use crate::configs::nodejs::NodejsConfig; use crate::formatter::{StringFormatter, VersionFormatter}; -use once_cell::sync::Lazy; use regex::Regex; use semver::Version; use semver::VersionReq; use serde_json as json; use std::ops::Deref; +use std::sync::LazyLock; /// Creates a module with the current Node.js version pub fn module<'a>(context: &'a Context) -> Option> { @@ -30,12 +30,12 @@ pub fn module<'a>(context: &'a Context) -> Option> { return None; } - let nodejs_version = Lazy::new(|| { + let nodejs_version = LazyLock::new(|| { context .exec_cmd("node", &["--version"]) .map(|cmd| cmd.stdout) }); - let engines_version = Lazy::new(|| get_engines_version(context)); + let engines_version = LazyLock::new(|| get_engines_version(context)); let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter diff --git a/src/modules/ocaml.rs b/src/modules/ocaml.rs index f947e03cc..410fa66d7 100644 --- a/src/modules/ocaml.rs +++ b/src/modules/ocaml.rs @@ -1,7 +1,7 @@ use super::{Context, Module, ModuleConfig}; -use once_cell::sync::Lazy; use std::ops::Deref; use std::path::Path; +use std::sync::LazyLock; use crate::configs::ocaml::OCamlConfig; use crate::formatter::StringFormatter; @@ -29,7 +29,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { return None; } - let opam_switch: Lazy, _> = Lazy::new(|| get_opam_switch(context)); + let opam_switch: LazyLock, _> = LazyLock::new(|| get_opam_switch(context)); let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter diff --git a/src/modules/raku.rs b/src/modules/raku.rs index 0e37b3640..56c90f0dc 100644 --- a/src/modules/raku.rs +++ b/src/modules/raku.rs @@ -3,8 +3,8 @@ use super::{Context, Module, ModuleConfig}; use crate::configs::raku::RakuConfig; use crate::formatter::StringFormatter; use crate::formatter::VersionFormatter; -use once_cell::sync::Lazy; use std::ops::Deref; +use std::sync::LazyLock; /// Creates a module with the current raku version pub fn module<'a>(context: &'a Context) -> Option> { @@ -21,7 +21,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { return None; } - let versions = Lazy::new(|| get_raku_version(context)); + let versions = LazyLock::new(|| get_raku_version(context)); let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter diff --git a/src/modules/rust.rs b/src/modules/rust.rs index 6544eba77..4c3020e6b 100644 --- a/src/modules/rust.rs +++ b/src/modules/rust.rs @@ -12,7 +12,7 @@ use crate::formatter::{StringFormatter, VersionFormatter}; use crate::utils::create_command; use home::rustup_home; -use once_cell::sync::OnceCell; +use std::sync::OnceLock; use guess_host_triple::guess_host_triple; @@ -22,23 +22,23 @@ type ToolchainString = String; /// A struct to cache the output of any commands that need to be run. struct RustToolingEnvironmentInfo { /// Rustup settings parsed from $HOME/.rustup/settings.toml - rustup_settings: OnceCell, + rustup_settings: OnceLock, /// Rustc toolchain overrides as contained in the environment or files - env_toolchain_override: OnceCell>, + env_toolchain_override: OnceLock>, /// The output of `rustup rustc --version` with a fixed toolchain - rustup_rustc_output: OnceCell, + rustup_rustc_output: OnceLock, /// The output of running rustc -vV. Only called if rustup rustc fails or /// is unavailable. - rustc_verbose_output: OnceCell>, + rustc_verbose_output: OnceLock>, } impl RustToolingEnvironmentInfo { fn new() -> Self { Self { - rustup_settings: OnceCell::new(), - env_toolchain_override: OnceCell::new(), - rustup_rustc_output: OnceCell::new(), - rustc_verbose_output: OnceCell::new(), + rustup_settings: OnceLock::new(), + env_toolchain_override: OnceLock::new(), + rustup_rustc_output: OnceLock::new(), + rustc_verbose_output: OnceLock::new(), } } @@ -500,9 +500,9 @@ impl RustupSettings { #[cfg(test)] mod tests { use crate::context::{Shell, Target}; - use once_cell::sync::Lazy; use std::io; use std::process::{ExitStatus, Output}; + use std::sync::LazyLock; use super::*; @@ -648,7 +648,7 @@ version = "12" #[cfg(windows)] use std::os::windows::process::ExitStatusExt as _; - static RUSTC_VERSION: Lazy = Lazy::new(|| Output { + static RUSTC_VERSION: LazyLock = LazyLock::new(|| Output { status: ExitStatus::from_raw(0), stdout: b"rustc 1.34.0\n"[..].to_owned(), stderr: vec![], @@ -658,7 +658,7 @@ version = "12" RustupRunRustcVersionOutcome::RustcVersion("rustc 1.34.0\n".to_owned()), ); - static TOOLCHAIN_NAME: Lazy = Lazy::new(|| Output { + static TOOLCHAIN_NAME: LazyLock = LazyLock::new(|| Output { status: ExitStatus::from_raw(1), stdout: vec![], stderr: b"error: toolchain 'channel-triple' is not installed\n"[..].to_owned(), @@ -668,7 +668,7 @@ version = "12" RustupRunRustcVersionOutcome::ToolchainNotInstalled("channel-triple".to_owned()), ); - static INVALID_STDOUT: Lazy = Lazy::new(|| Output { + static INVALID_STDOUT: LazyLock = LazyLock::new(|| Output { status: ExitStatus::from_raw(0), stdout: b"\xc3\x28"[..].to_owned(), stderr: vec![], @@ -678,7 +678,7 @@ version = "12" RustupRunRustcVersionOutcome::Err, ); - static INVALID_STDERR: Lazy = Lazy::new(|| Output { + static INVALID_STDERR: LazyLock = LazyLock::new(|| Output { status: ExitStatus::from_raw(1), stdout: vec![], stderr: b"\xc3\x28"[..].to_owned(), @@ -688,7 +688,7 @@ version = "12" RustupRunRustcVersionOutcome::Err, ); - static UNEXPECTED_FORMAT_OF_ERROR: Lazy = Lazy::new(|| Output { + static UNEXPECTED_FORMAT_OF_ERROR: LazyLock = LazyLock::new(|| Output { status: ExitStatus::from_raw(1), stdout: vec![], stderr: b"error:"[..].to_owned(), diff --git a/src/test/mod.rs b/src/test/mod.rs index 230e4cd82..701315e7a 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -5,18 +5,18 @@ use crate::{ utils::{create_command, CommandOutput}, }; use log::{Level, LevelFilter}; -use once_cell::sync::Lazy; use std::fs; use std::io; use std::path::{Path, PathBuf}; +use std::sync::LazyLock; use std::sync::Once; use tempfile::TempDir; -static FIXTURE_DIR: Lazy = - Lazy::new(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("src/test/fixtures/")); +static FIXTURE_DIR: LazyLock = + LazyLock::new(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("src/test/fixtures/")); -static GIT_FIXTURE: Lazy = Lazy::new(|| FIXTURE_DIR.join("git-repo.bundle")); -static HG_FIXTURE: Lazy = Lazy::new(|| FIXTURE_DIR.join("hg-repo.bundle")); +static GIT_FIXTURE: LazyLock = LazyLock::new(|| FIXTURE_DIR.join("git-repo.bundle")); +static HG_FIXTURE: LazyLock = LazyLock::new(|| FIXTURE_DIR.join("hg-repo.bundle")); static LOGGER: Once = Once::new();