aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installed_versions.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-17 22:57:49 +0900
committernsfisis <nsfisis@gmail.com>2026-05-17 22:57:49 +0900
commit5461c8cffe839b49ae38e67146b4672bfd96d687 (patch)
treed41cfbdd727deae9c35855a0e67675ce2993f755 /crates/shirabe/src/installed_versions.rs
parente752ff0a7e21334c0b9b9e1b87d4965ea8760fd5 (diff)
downloadphp-shirabe-5461c8cffe839b49ae38e67146b4672bfd96d687.tar.gz
php-shirabe-5461c8cffe839b49ae38e67146b4672bfd96d687.tar.zst
php-shirabe-5461c8cffe839b49ae38e67146b4672bfd96d687.zip
fix(compile): use std::sync::LazyLock for global cache
Diffstat (limited to 'crates/shirabe/src/installed_versions.rs')
-rw-r--r--crates/shirabe/src/installed_versions.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/shirabe/src/installed_versions.rs b/crates/shirabe/src/installed_versions.rs
index b151d96..c79e9d8 100644
--- a/crates/shirabe/src/installed_versions.rs
+++ b/crates/shirabe/src/installed_versions.rs
@@ -38,8 +38,9 @@ static CAN_GET_VENDORS: Mutex<Option<bool>> = Mutex::new(None);
/// @var array[]
/// @psalm-var array<string, array{...}>
-static INSTALLED_BY_VENDOR: Mutex<IndexMap<String, IndexMap<String, PhpMixed>>> =
- Mutex::new(IndexMap::new());
+static INSTALLED_BY_VENDOR: std::sync::LazyLock<
+ Mutex<IndexMap<String, IndexMap<String, PhpMixed>>>,
+> = std::sync::LazyLock::new(|| Mutex::new(IndexMap::new()));
impl InstalledVersions {
/// Returns a list of all package names which are present, either by being installed, replaced or provided