Skip to content

Commit

Permalink
tests: Use Once instead of OnceLock
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 9, 2025
1 parent 7ff4157 commit c6bb69d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
path::{Path, PathBuf},
process::{Command, ExitStatus, Stdio},
str,
sync::OnceLock,
sync::Once,
};

use anyhow::Context as _;
Expand All @@ -20,8 +20,8 @@ pub(crate) fn fixtures_path() -> &'static Path {
}

fn ensure_llvm_tools_installed() {
static TEST_VERSION: OnceLock<()> = OnceLock::new();
TEST_VERSION.get_or_init(|| {
static TEST_VERSION: Once = Once::new();
TEST_VERSION.call_once(|| {
// Install component first to avoid component installation conflicts.
let _ = Command::new("rustup").args(["component", "add", "llvm-tools-preview"]).output();
});
Expand Down

0 comments on commit c6bb69d

Please sign in to comment.