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 | |
| parent | 6163b769290945be4706b7956ad5ca27a177590d (diff) | |
| download | mullvadvpn-e2d67b8b81115a28074dd1eaa60d88666becf305.tar.xz mullvadvpn-e2d67b8b81115a28074dd1eaa60d88666becf305.zip | |
Remove `once_cell` from `test` workspace
| -rw-r--r-- | test/Cargo.lock | 2 | ||||
| -rw-r--r-- | test/Cargo.toml | 1 | ||||
| -rw-r--r-- | test/test-manager/Cargo.toml | 1 | ||||
| -rw-r--r-- | test/test-manager/src/tests/config.rs | 12 | ||||
| -rw-r--r-- | test/test-runner/Cargo.toml | 1 | ||||
| -rw-r--r-- | test/test-runner/src/net.rs | 4 |
6 files changed, 10 insertions, 11 deletions
diff --git a/test/Cargo.lock b/test/Cargo.lock index 1c7324b2c5..24852c3356 100644 --- a/test/Cargo.lock +++ b/test/Cargo.lock @@ -3453,7 +3453,6 @@ dependencies = [ "mullvad-types", "mullvad-version", "nix 0.29.0", - "once_cell", "pcap", "pnet_base", "pnet_packet", @@ -3515,7 +3514,6 @@ dependencies = [ "log", "mullvad-paths", "nix 0.29.0", - "once_cell", "parity-tokio-ipc", "plist", "rand 0.8.5", diff --git a/test/Cargo.toml b/test/Cargo.toml index 8c691719ec..6215916992 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -75,7 +75,6 @@ shadowsocks-service = "1.20.3" windows-sys = "0.52.0" chrono = { version = "0.4.26", default-features = false } clap = { version = "4.2.7", features = ["cargo", "derive"] } -once_cell = "1.16.0" bytes = "1.3.0" async-trait = "0.1.58" surge-ping = "0.8" diff --git a/test/test-manager/Cargo.toml b/test/test-manager/Cargo.toml index 8be5cda406..2671ea454a 100644 --- a/test/test-manager/Cargo.toml +++ b/test/test-manager/Cargo.toml @@ -22,7 +22,6 @@ thiserror = { workspace = true } bytes = { workspace = true } test_macro = { path = "./test_macro" } ipnetwork = "0.20" -once_cell = { workspace = true } inventory = "0.3" data-encoding-macro = "0.1.12" itertools = "0.10.5" 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()); diff --git a/test/test-runner/Cargo.toml b/test/test-runner/Cargo.toml index 8df61e7164..fd53f4b7cb 100644 --- a/test/test-runner/Cargo.toml +++ b/test/test-runner/Cargo.toml @@ -18,7 +18,6 @@ tokio = { workspace = true } tokio-serial = { workspace = true } thiserror = { workspace = true } log = { workspace = true } -once_cell = { workspace = true } parity-tokio-ipc = "0.9" bytes = { workspace = true } serde = { workspace = true } diff --git a/test/test-runner/src/net.rs b/test/test-runner/src/net.rs index a12fa2776c..7d32f04812 100644 --- a/test/test-runner/src/net.rs +++ b/test/test-runner/src/net.rs @@ -251,10 +251,10 @@ pub fn get_interface_mac(_interface: &str) -> Result<Option<[u8; 6]>, test_rpc:: #[cfg(target_os = "windows")] pub fn get_default_interface() -> &'static str { - use once_cell::sync::OnceCell; + use std::sync::OnceLock; use talpid_platform_metadata::WindowsVersion; - static WINDOWS_VERSION: OnceCell<WindowsVersion> = OnceCell::new(); + static WINDOWS_VERSION: OnceLock<WindowsVersion> = OnceLock::new(); let version = WINDOWS_VERSION .get_or_init(|| WindowsVersion::new().expect("failed to obtain Windows version")); |
