From c6bb69d977514549cb251e50168f9b7355e29c9f Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Fri, 10 Jan 2025 01:56:00 +0900 Subject: [PATCH] tests: Use Once instead of OnceLock --- tests/auxiliary/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auxiliary/mod.rs b/tests/auxiliary/mod.rs index b6b02414..fdce2ad3 100644 --- a/tests/auxiliary/mod.rs +++ b/tests/auxiliary/mod.rs @@ -8,7 +8,7 @@ use std::{ path::{Path, PathBuf}, process::{Command, ExitStatus, Stdio}, str, - sync::OnceLock, + sync::Once, }; use anyhow::Context as _; @@ -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(); });