diff options
Diffstat (limited to 'test/test-runner')
| -rw-r--r-- | test/test-runner/src/logging.rs | 6 | ||||
| -rw-r--r-- | test/test-runner/src/sys.rs | 17 |
2 files changed, 11 insertions, 12 deletions
diff --git a/test/test-runner/src/logging.rs b/test/test-runner/src/logging.rs index 6ca19c2c63..bab3693c34 100644 --- a/test/test-runner/src/logging.rs +++ b/test/test-runner/src/logging.rs @@ -76,7 +76,7 @@ pub async fn get_mullvad_app_logs() -> LogOutput { async fn read_settings_file() -> Result<String, Error> { let mut settings_path = mullvad_paths::get_default_settings_dir() - .map_err(|error| Error::Logs(format!("{}", error)))?; + .map_err(|error| Error::Logs(format!("{error}")))?; settings_path.push("settings.json"); read_truncated(&settings_path, None) .await @@ -85,10 +85,10 @@ async fn read_settings_file() -> Result<String, Error> { async fn read_log_files() -> Result<Vec<Result<LogFile, Error>>, Error> { let log_dir = - mullvad_paths::get_default_log_dir().map_err(|error| Error::Logs(format!("{}", error)))?; + mullvad_paths::get_default_log_dir().map_err(|error| Error::Logs(format!("{error}")))?; let paths = list_logs(log_dir) .await - .map_err(|error| Error::Logs(format!("{}", error)))?; + .map_err(|error| Error::Logs(format!("{error}")))?; let mut log_files = Vec::new(); for path in paths { let log_file = read_truncated(&path, Some(TRUNCATE_LOG_FILE_LINES)) diff --git a/test/test-runner/src/sys.rs b/test/test-runner/src/sys.rs index 5f461f9013..024e1153c9 100644 --- a/test/test-runner/src/sys.rs +++ b/test/test-runner/src/sys.rs @@ -505,11 +505,11 @@ pub async fn set_daemon_environment(env: HashMap<String, String>) -> Result<(), let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); let path = Path::new(MULLVAD_WIN_REGISTRY).join("Environment"); let (registry, _) = hklm.create_subkey(&path).map_err(|error| { - test_rpc::Error::Registry(format!("Failed to open Mullvad VPN subkey: {}", error)) + test_rpc::Error::Registry(format!("Failed to open Mullvad VPN subkey: {error}")) })?; for (k, v) in env { registry.set_value(k, &v).map_err(|error| { - test_rpc::Error::Registry(format!("Failed to set Environment var: {}", error)) + test_rpc::Error::Registry(format!("Failed to set Environment var: {error}")) })?; } @@ -528,12 +528,12 @@ pub fn get_system_path_var() -> Result<String, test_rpc::Error> { let key = hklm .open_subkey("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment") .map_err(|error| { - test_rpc::Error::Registry(format!("Failed to open Environment subkey: {}", error)) + test_rpc::Error::Registry(format!("Failed to open Environment subkey: {error}")) })?; let path: String = key .get_value("Path") - .map_err(|error| test_rpc::Error::Registry(format!("Failed to get PATH: {}", error)))?; + .map_err(|error| test_rpc::Error::Registry(format!("Failed to get PATH: {error}")))?; Ok(path) } @@ -642,7 +642,7 @@ pub async fn get_daemon_environment() -> Result<HashMap<String, String>, test_rp tokio::task::spawn_blocking(|| -> Result<HashMap<String, String>, test_rpc::Error> { let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); let key = hklm.open_subkey(MULLVAD_WIN_REGISTRY).map_err(|error| { - test_rpc::Error::Registry(format!("Failed to open Mullvad VPN subkey: {}", error)) + test_rpc::Error::Registry(format!("Failed to open Mullvad VPN subkey: {error}")) })?; // The Strings will be quoted (surrounded by ") when read from the registry - we should @@ -651,10 +651,9 @@ pub async fn get_daemon_environment() -> Result<HashMap<String, String>, test_rp let env = key .open_subkey("Environment") .map_err(|error| { - test_rpc::Error::Registry(format!( - "Failed to open Environment subkey: {}", - error - )) + test_rpc::Error::Registry( + format!("Failed to open Environment subkey: {error}",), + ) })? .enum_values() .filter_map(|x| x.inspect_err(|err| log::trace!("{err}")).ok()) |
