about summary refs log tree commit diff
path: root/tvix/castore/src/directoryservice/from_addr.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-10-13T15·31+0300
committerclbot <clbot@tvl.fyi>2024-10-17T21·17+0000
commitcdbdd2d04ecb2675f9c1d7ded7d99ad3a483b6fc (patch)
tree83c68d68e44e3b056213c58e4c9f03e18a1fb860 /tvix/castore/src/directoryservice/from_addr.rs
parenta94414e7ffc5c21874fa0ea6e92aa63fcc55cb7d (diff)
refactor(tvix/castore): remove use of lazy_static r/8823
This is now supported in the standard library via std::sync::LazyLock,
but requires some manual shuffling around of code.

Change-Id: Ia0370ca46cb1c6122a452b1d117160536b632c7e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12612
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/castore/src/directoryservice/from_addr.rs')
-rw-r--r--tvix/castore/src/directoryservice/from_addr.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/tvix/castore/src/directoryservice/from_addr.rs b/tvix/castore/src/directoryservice/from_addr.rs
index 244d78a17bf0..2f7fc6d7de5a 100644
--- a/tvix/castore/src/directoryservice/from_addr.rs
+++ b/tvix/castore/src/directoryservice/from_addr.rs
@@ -45,15 +45,14 @@ pub async fn from_addr(
 
 #[cfg(test)]
 mod tests {
+    use std::sync::LazyLock;
+
     use super::from_addr;
-    use lazy_static::lazy_static;
     use rstest::rstest;
     use tempfile::TempDir;
 
-    lazy_static! {
-        static ref TMPDIR_REDB_1: TempDir = TempDir::new().unwrap();
-        static ref TMPDIR_REDB_2: TempDir = TempDir::new().unwrap();
-    }
+    static TMPDIR_REDB_1: LazyLock<TempDir> = LazyLock::new(|| TempDir::new().unwrap());
+    static TMPDIR_REDB_2: LazyLock<TempDir> = LazyLock::new(|| TempDir::new().unwrap());
 
     #[rstest]
     /// This uses an unsupported scheme.