diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-11-05 09:14:07 +0100 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-11-08 13:09:06 +0100 |
| commit | e2d67b8b81115a28074dd1eaa60d88666becf305 (patch) | |
| tree | a2b784833c207bae627623c99ac4c2a9ca2cbdaf /test/test-manager/src/tests | |
| parent | 6163b769290945be4706b7956ad5ca27a177590d (diff) | |
| download | mullvadvpn-e2d67b8b81115a28074dd1eaa60d88666becf305.tar.xz mullvadvpn-e2d67b8b81115a28074dd1eaa60d88666becf305.zip | |
Remove `once_cell` from `test` workspace
Diffstat (limited to 'test/test-manager/src/tests')
| -rw-r--r-- | test/test-manager/src/tests/config.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test-manager/src/tests/config.rs b/test/test-manager/src/tests/config.rs index ae2f434698..04b2e01e71 100644 --- a/test/test-manager/src/tests/config.rs +++ b/test/test-manager/src/tests/config.rs @@ -1,7 +1,9 @@ -use once_cell::sync::OnceCell; +use std::sync::OnceLock; use std::{ops::Deref, path::Path}; use test_rpc::meta::Os; +pub static TEST_CONFIG: TestConfigContainer = TestConfigContainer::new(); + /// Default `mullvad_host`. This should match the production env. pub const DEFAULT_MULLVAD_HOST: &str = "mullvad.net"; /// Bundled OpenVPN CA certificate use with the installed Mullvad app. @@ -110,9 +112,13 @@ impl Default for BootstrapScript { } #[derive(Debug, Clone)] -pub struct TestConfigContainer(OnceCell<TestConfig>); +pub struct TestConfigContainer(OnceLock<TestConfig>); impl TestConfigContainer { + const fn new() -> Self { + TestConfigContainer(OnceLock::new()) + } + /// Initializes the constants. /// /// # Panics @@ -130,5 +136,3 @@ impl Deref for TestConfigContainer { self.0.get().unwrap() } } - -pub static TEST_CONFIG: TestConfigContainer = TestConfigContainer(OnceCell::new()); |
