diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 22:57:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 22:57:49 +0900 |
| commit | 5461c8cffe839b49ae38e67146b4672bfd96d687 (patch) | |
| tree | d41cfbdd727deae9c35855a0e67675ce2993f755 /crates/shirabe | |
| parent | e752ff0a7e21334c0b9b9e1b87d4965ea8760fd5 (diff) | |
| download | php-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')
| -rw-r--r-- | crates/shirabe/src/installed_versions.rs | 5 |
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 |
