diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-06-20 14:28:23 +0200 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-06-24 09:03:31 +0200 |
| commit | 8c9cb717c020072a3859fe3d44f6147c37c67c33 (patch) | |
| tree | d0892de4376df331afca1e5090913c9d67a899c8 | |
| parent | 02089db6e0494e1a86f135f9a12f1c209314f499 (diff) | |
| download | mullvadvpn-8c9cb717c020072a3859fe3d44f6147c37c67c33.tar.xz mullvadvpn-8c9cb717c020072a3859fe3d44f6147c37c67c33.zip | |
Run `cargo +nightly fmt`
23 files changed, 85 insertions, 70 deletions
diff --git a/mullvad-cli/src/cmds/patch.rs b/mullvad-cli/src/cmds/patch.rs index 2aa48f2b2f..cd1a970a3b 100644 --- a/mullvad-cli/src/cmds/patch.rs +++ b/mullvad-cli/src/cmds/patch.rs @@ -9,8 +9,7 @@ use std::{ /// application. /// /// * If `source` is "-", read the patch from standard input -/// * Otherwise, interpret `source` as a filepath and read from the provided -/// file +/// * Otherwise, interpret `source` as a filepath and read from the provided file pub async fn import(source: String) -> Result<()> { let json_blob = tokio::task::spawn_blocking(move || match source.as_str() { "-" => read_to_string(BufReader::new(stdin())).context("Failed to read from stdin"), @@ -33,8 +32,7 @@ pub async fn import(source: String) -> Result<()> { /// Output a settings patch including all currently patchable settings. /// /// * If `source` is "-", write the patch to standard output -/// * Otherwise, interpret `source` as a filepath and write to the provided -/// file +/// * Otherwise, interpret `source` as a filepath and write to the provided file pub async fn export(dest: String) -> Result<()> { let mut rpc = MullvadProxyClient::new().await?; let blob = rpc diff --git a/mullvad-daemon/src/migrations/v7.rs b/mullvad-daemon/src/migrations/v7.rs index 4614cedce9..56225aa7b0 100644 --- a/mullvad-daemon/src/migrations/v7.rs +++ b/mullvad-daemon/src/migrations/v7.rs @@ -76,10 +76,10 @@ pub struct ShadowsocksProxySettings { /// and Shadowsocks variant. /// /// The predefined access methods "Direct" and "Mullvad Bridges" are now stored as distinct keys in -/// the api_access_methods settings, separating them from user-defined access methods in the settings -/// datastructure. +/// the api_access_methods settings, separating them from user-defined access methods in the +/// settings data structure. /// -/// We also take the oppertunity to rename a couple of fields that relate to proxy types. +/// We also take the opportunity to rename a couple of fields that relate to proxy types. /// We rename /// - shadowsocks.peer to shadowsocks.endpoint /// - socks5_remote.authentication to socks5_remote.auth @@ -145,10 +145,12 @@ fn migrate_api_access_settings(settings: &mut serde_json::Value) -> Result<()> { } } - // Step 1. Rename { "api_access_methods": { "access_method_settings": .. } } to { "api_access_methods": { "custom": .. } }. - // Step 2. Collect all of the built-in methods from { "api_access_methods": { "custom": [ .. ] } }. - // Step 3. Remove all of the built-in methods from { "api_access_methods": { "custom": [ .. ] } }. - // Step 4. Add the collected built-in methods from step 2 to { "api_access_methods": { .. } } under some appropriate key. + // Step 1. Rename { "api_access_methods": { "access_method_settings": .. } } to + // {"api_access_methods": { "custom": .. } }. + // Step 2. Collect all of the built-in methods from {"api_access_methods": {"custom": [ .. ] } } + // Step 3. Remove all of the built-in methods from {"api_access_methods": {"custom": [..] } } + // Step 4. Add the collected built-in methods from step 2 to { "api_access_methods": { .. } } + // under some appropriate key. if let Some(access_method_settings) = settings .get_mut("api_access_methods") .and_then(serde_json::value::Value::as_object_mut) diff --git a/mullvad-daemon/src/migrations/v9.rs b/mullvad-daemon/src/migrations/v9.rs index 1c5cf1305c..1275c488e1 100644 --- a/mullvad-daemon/src/migrations/v9.rs +++ b/mullvad-daemon/src/migrations/v9.rs @@ -60,8 +60,8 @@ pub fn migrate( // TODO: Remove this comment when closing the migration: // While this is an open migration, we check to see if the split tunnel apps have been migrated - // already. If so, we don't want to run the migration code again. The call to `split_tunnel_subkey_exists` - // can safely be removed when closing this migration. + // already. If so, we don't want to run the migration code again. The call to + // `split_tunnel_subkey_exists` can safely be removed when closing this migration. #[cfg(target_os = "android")] if !android::split_tunnel_subkey_exists(json_blob) { if let Some(directories) = directories { @@ -136,7 +136,8 @@ mod android { enabled: bool, apps: Vec<String>, ) { - // Create the "split_tunnel" key in the settings object and store the read split tunnel state in the daemon's settings + // Create the "split_tunnel" key in the settings object and store the read split tunnel + // state in the daemon's settings settings.insert( "split_tunnel".to_string(), json!({ "enable_exclusions": enabled, "apps": apps }), @@ -144,8 +145,8 @@ mod android { } /// Read the target file and parse the stored split tunneling state. If split tunneling was - /// previously enabled in the android app, the return value of this function will be `Some(true)`, - /// otherwise `Some(false)`. + /// previously enabled in the android app, the return value of this function will be + /// `Some(true)`, otherwise `Some(false)`. /// /// If the file could not be found or read, some logging will occur and `None` will be returned. pub fn read_split_tunnel_state(directories: &Directories<'_>) -> Option<bool> { @@ -179,7 +180,8 @@ mod android { } /// Remove the lingering, old files split tunnelling related files. They should have been - /// completely migrated to the daemon settings at this point, so they won't be needed any longer. + /// completely migrated to the daemon settings at this point, so they won't be needed any + /// longer. /// /// Note: We don't really care if these operations fail - they won't ever be read again, and new /// app installations shall not create them. diff --git a/mullvad-daemon/src/settings/mod.rs b/mullvad-daemon/src/settings/mod.rs index ef24b7f61d..ef666c34ef 100644 --- a/mullvad-daemon/src/settings/mod.rs +++ b/mullvad-daemon/src/settings/mod.rs @@ -1,7 +1,7 @@ #[cfg(not(target_os = "android"))] use futures::TryFutureExt; -use mullvad_types::custom_list::Error as CustomListError; use mullvad_types::{ + custom_list::Error as CustomListError, relay_constraints::{RelayConstraints, RelaySettings, WireguardConstraints}, settings::{DnsState, Settings}, }; diff --git a/mullvad-relay-selector/src/error.rs b/mullvad-relay-selector/src/error.rs index f988be1b89..3e70f2429b 100644 --- a/mullvad-relay-selector/src/error.rs +++ b/mullvad-relay-selector/src/error.rs @@ -42,7 +42,8 @@ pub enum EndpointErrorDetails { /// No valid Wireguard endpoint could be constructed from this [`WireguardConfig`]. /// /// # Note - /// The inner value is boxed to not bloat the size of [`Error`] due to the size of [`WireguardConfig`]. + /// The inner value is boxed to not bloat the size of [`Error`] due to the size of + /// [`WireguardConfig`]. Wireguard(Box<WireguardConfig>), /// No valid OpenVPN endpoint could be constructed from this [`Relay`] /// diff --git a/mullvad-relay-selector/src/relay_selector/parsed_relays.rs b/mullvad-relay-selector/src/relay_selector/parsed_relays.rs index 7b53b529ee..35c78a52aa 100644 --- a/mullvad-relay-selector/src/relay_selector/parsed_relays.rs +++ b/mullvad-relay-selector/src/relay_selector/parsed_relays.rs @@ -129,8 +129,9 @@ impl ParsedRelays { Ok((last_modified, file)) } - /// Create a new [`ParsedRelays`] from [relay_list][`RelayList`] and [overrides][`RelayOverride`]. - /// This will apply `overrides` to `relay_list` and store the result in `self.parsed_list`. + /// Create a new [`ParsedRelays`] from [relay_list][`RelayList`] and + /// [overrides][`RelayOverride`]. This will apply `overrides` to `relay_list` and store the + /// result in `self.parsed_list`. pub(crate) fn from_relay_list( relay_list: RelayList, last_updated: SystemTime, diff --git a/mullvad-types/src/relay_list.rs b/mullvad-types/src/relay_list.rs index 7153216f43..054752d592 100644 --- a/mullvad-types/src/relay_list.rs +++ b/mullvad-types/src/relay_list.rs @@ -87,7 +87,8 @@ pub struct Relay { } impl PartialEq for Relay { - /// Hostnames are assumed to be unique per relay, i.e. a relay can be uniquely identified by its hostname. + /// Hostnames are assumed to be unique per relay, i.e. a relay can be uniquely identified by its + /// hostname. /// /// # Example /// @@ -128,10 +129,12 @@ impl PartialEq for Relay { } } -/// Hostnames are assumed to be unique per relay, i.e. a relay can be uniquely identified by its hostname. +/// Hostnames are assumed to be unique per relay, i.e. a relay can be uniquely identified by its +/// hostname. impl Eq for Relay {} -/// Hostnames are assumed to be unique per relay, i.e. a relay can be uniquely identified by its hostname. +/// Hostnames are assumed to be unique per relay, i.e. a relay can be uniquely identified by its +/// hostname. impl std::hash::Hash for Relay { fn hash<H: std::hash::Hasher>(&self, state: &mut H) { self.hostname.hash(state) diff --git a/mullvad-types/src/settings/mod.rs b/mullvad-types/src/settings/mod.rs index 5dd16733f9..038b0db803 100644 --- a/mullvad-types/src/settings/mod.rs +++ b/mullvad-types/src/settings/mod.rs @@ -122,7 +122,8 @@ pub struct SplitApp(String); #[cfg(any(windows, target_os = "macos"))] impl SplitApp { /// Convert the underlying path to a [`String`]. - /// This function will fail if the underlying path string is not valid UTF-8. See [`std::ffi::OsStr::to_str`] for details. + /// This function will fail if the underlying path string is not valid UTF-8. See + /// [`std::ffi::OsStr::to_str`] for details. pub fn to_string(self) -> Option<String> { self.0.as_os_str().to_str().map(str::to_string) } @@ -142,7 +143,8 @@ impl SplitApp { /// Convert the underlying app name to a [`String`]. /// /// # Note - /// This function is fallible due to the Window's dito being fallible, and it is convenient to have the same API across all platforms. + /// This function is fallible due to the Window's dito being fallible, and it is convenient to + /// have the same API across all platforms. pub fn to_string(self) -> Option<String> { Some(self.0) } diff --git a/mullvad-types/src/version.rs b/mullvad-types/src/version.rs index 3c371bbaf0..8b696896a7 100644 --- a/mullvad-types/src/version.rs +++ b/mullvad-types/src/version.rs @@ -1,8 +1,11 @@ use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; -use std::fmt::{self, Formatter}; -use std::{cmp::Ordering, str::FromStr}; +use std::{ + cmp::Ordering, + fmt::{self, Formatter}, + str::FromStr, +}; static STABLE_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"^(\d{4})\.(\d+)$").unwrap()); static BETA_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"^(\d{4})\.(\d+)-beta(\d+)$").unwrap()); diff --git a/talpid-core/src/offline/mod.rs b/talpid-core/src/offline/mod.rs index ede1943311..cb3d1d8b29 100644 --- a/talpid-core/src/offline/mod.rs +++ b/talpid-core/src/offline/mod.rs @@ -4,8 +4,7 @@ use once_cell::sync::Lazy; use talpid_routing::RouteManagerHandle; #[cfg(target_os = "android")] use talpid_types::android::AndroidContext; -use talpid_types::net::Connectivity; -use talpid_types::ErrorExt; +use talpid_types::{net::Connectivity, ErrorExt}; #[cfg(target_os = "macos")] #[path = "macos.rs"] diff --git a/talpid-core/src/split_tunnel/macos/bindings.rs b/talpid-core/src/split_tunnel/macos/bindings.rs index 69aabfc0e9..931ac84d2e 100644 --- a/talpid-core/src/split_tunnel/macos/bindings.rs +++ b/talpid-core/src/split_tunnel/macos/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.2 */ +// automatically generated by rust-bindgen 0.69.2 pub const PTH_FLAG_DIR_OUT: u32 = 2; pub const PCAP_ERRBUF_SIZE: u32 = 256; diff --git a/talpid-core/src/split_tunnel/macos/mod.rs b/talpid-core/src/split_tunnel/macos/mod.rs index 000ee87dd0..d5c7a508c3 100644 --- a/talpid-core/src/split_tunnel/macos/mod.rs +++ b/talpid-core/src/split_tunnel/macos/mod.rs @@ -1,10 +1,11 @@ use core::fmt; -use std::collections::HashSet; -use std::path::PathBuf; -use std::sync::{Arc, Weak}; +use std::{ + collections::HashSet, + path::PathBuf, + sync::{Arc, Weak}, +}; use talpid_routing::RouteManagerHandle; -use talpid_types::tunnel::ErrorStateCause; -use talpid_types::ErrorExt; +use talpid_types::{tunnel::ErrorStateCause, ErrorExt}; use tokio::sync::{mpsc, oneshot}; use self::process::ExclusionStatus; @@ -407,7 +408,8 @@ impl State { } // If 'paths' is empty, do nothing State::NoExclusions { .. } => Ok(self), - // If split tunneling is already initialized, or only the process monitor is, update the paths only + // If split tunneling is already initialized, or only the process monitor is, update the + // paths only State::Initialized { ref mut process, .. } diff --git a/talpid-core/src/split_tunnel/macos/process.rs b/talpid-core/src/split_tunnel/macos/process.rs index 013aca34e4..49ea29e8a8 100644 --- a/talpid-core/src/split_tunnel/macos/process.rs +++ b/talpid-core/src/split_tunnel/macos/process.rs @@ -9,9 +9,8 @@ use futures::channel::oneshot; use libc::{proc_listallpids, proc_pidpath}; use once_cell::sync::Lazy; use serde::Deserialize; -use std::collections::HashSet; use std::{ - collections::HashMap, + collections::{HashMap, HashSet}, ffi::c_void, io, path::PathBuf, diff --git a/talpid-core/src/split_tunnel/macos/tun.rs b/talpid-core/src/split_tunnel/macos/tun.rs index 7236f81ed4..f5f7211499 100644 --- a/talpid-core/src/split_tunnel/macos/tun.rs +++ b/talpid-core/src/split_tunnel/macos/tun.rs @@ -20,9 +20,8 @@ use pnet_packet::{ udp::MutableUdpPacket, MutablePacket, Packet, }; -use std::ffi::c_uint; use std::{ - ffi::CStr, + ffi::{c_uint, CStr}, io::{self, IoSlice, Write}, net::{Ipv4Addr, Ipv6Addr}, ptr::NonNull, @@ -269,7 +268,8 @@ fn redirect_packets_for_pktap_stream( }) } -/// Open a BPF device for the specified default interface. Return a read and write half, and the buffer size. +/// Open a BPF device for the specified default interface. Return a read and write half, and the +/// buffer size. fn open_default_bpf( default_interface: &DefaultInterface, ) -> Result<(bpf::BpfStream, bpf::WriteHalf, usize), Error> { @@ -692,7 +692,7 @@ fn capture_outbound_packets( // TODO: This is unsupported on macOS 13 and lower, so we determine the direction using the // pktap header flags. Once macOS 13 is no longer supported, this can be uncommented. - //cap.direction(pcap::Direction::Out) + // cap.direction(pcap::Direction::Out) // .map_err(Error::SetDirection)?; let cap = cap.setnonblock().map_err(Error::EnableNonblock)?; diff --git a/talpid-core/src/split_tunnel/windows/path_monitor.rs b/talpid-core/src/split_tunnel/windows/path_monitor.rs index 5dfff9dfb9..ad8d9ca1a3 100644 --- a/talpid-core/src/split_tunnel/windows/path_monitor.rs +++ b/talpid-core/src/split_tunnel/windows/path_monitor.rs @@ -10,10 +10,10 @@ // update. // This would still have the limitation that changes to symlinks would not be detected without // any monitoring. Assume that C:\a.exe is a symlink that points to -// \Device\HarddiskVolume1\test.exe. If C:\a.exe were deleted or replaced with a symlink pointing -// to \Device\HarddiskVolume2\lol.exe instead, then those old processes whose image is -// \Device\HarddiskVolume1\test.exe would still be excluded from the tunnel. This might be an -// acceptable limitation. +// \Device\HarddiskVolume1\test.exe. If C:\a.exe were deleted or replaced with a symlink +// pointing to \Device\HarddiskVolume2\lol.exe instead, then those old processes whose image +// is \Device\HarddiskVolume1\test.exe would still be excluded from the tunnel. This might be +// an acceptable limitation. use std::{ collections::HashSet, diff --git a/talpid-platform-metadata/src/macos.rs b/talpid-platform-metadata/src/macos.rs index f68cabb82b..b4a279f0e1 100644 --- a/talpid-platform-metadata/src/macos.rs +++ b/talpid-platform-metadata/src/macos.rs @@ -1,9 +1,7 @@ mod command; use command::command_stdout_lossy; -use std::cmp::Ordering; -use std::fmt::Formatter; -use std::{fmt, io}; +use std::{cmp::Ordering, fmt, fmt::Formatter, io}; pub fn version() -> String { let version = MacosVersion::new() diff --git a/talpid-routing/src/unix/macos/interface.rs b/talpid-routing/src/unix/macos/interface.rs index 13ae82b6d7..43e30d3549 100644 --- a/talpid-routing/src/unix/macos/interface.rs +++ b/talpid-routing/src/unix/macos/interface.rs @@ -11,14 +11,13 @@ use std::{ }; use super::data::{Destination, RouteMessage}; -use system_configuration::core_foundation::string::CFStringRef; use system_configuration::{ core_foundation::{ array::CFArray, base::{CFType, TCFType, ToVoid}, dictionary::CFDictionary, runloop::{kCFRunLoopCommonModes, CFRunLoop}, - string::CFString, + string::{CFString, CFStringRef}, }, dynamic_store::{SCDynamicStore, SCDynamicStoreBuilder, SCDynamicStoreCallBackContext}, network_configuration::SCNetworkSet, diff --git a/talpid-routing/src/unix/mod.rs b/talpid-routing/src/unix/mod.rs index 5f14d88d67..044a09433a 100644 --- a/talpid-routing/src/unix/mod.rs +++ b/talpid-routing/src/unix/mod.rs @@ -196,7 +196,7 @@ impl RouteManagerHandle { .map_err(Error::PlatformError) } - /// Removes all routes previously applied in [`RouteManager::add_routes`]. + /// Removes all routes previously applied in [`RouteManagerHandle::add_routes`]. pub fn clear_routes(&self) -> Result<(), Error> { self.tx .unbounded_send(RouteManagerCommand::ClearRoutes) diff --git a/talpid-tunnel-config-client/src/ios_ffi/ios_runtime.rs b/talpid-tunnel-config-client/src/ios_ffi/ios_runtime.rs index 1ab08a19bc..a395eb1ab4 100644 --- a/talpid-tunnel-config-client/src/ios_ffi/ios_runtime.rs +++ b/talpid-tunnel-config-client/src/ios_ffi/ios_runtime.rs @@ -96,8 +96,10 @@ impl IOSRuntime { self.run_service_inner(); }); } - /// Creates a `RelayConfigService` using the in-tunnel TCP Connection provided by the Packet Tunnel Provider - /// # Safety + /// Creates a `RelayConfigService` using the in-tunnel TCP Connection provided by the Packet + /// Tunnel Provider + /// + /// ## Safety /// It is unsafe to call this with an already used `SwiftContext` async unsafe fn ios_tcp_client( ctx: SwiftContext, diff --git a/talpid-tunnel-config-client/src/lib.rs b/talpid-tunnel-config-client/src/lib.rs index 62c124dd44..d5be332603 100644 --- a/talpid-tunnel-config-client/src/lib.rs +++ b/talpid-tunnel-config-client/src/lib.rs @@ -155,8 +155,8 @@ pub async fn request_ephemeral_peer_with( actual: ciphertexts.len(), })?; - // Store the PSK data on the heap. So it can be passed around and then zeroized on drop without - // being stored in a bunch of places on the stack. + // Store the PSK data on the heap. So it can be passed around and then zeroized on drop + // without being stored in a bunch of places on the stack. let mut psk_data = Box::new([0u8; 32]); // Decapsulate Classic McEliece and mix into PSK @@ -164,9 +164,9 @@ pub async fn request_ephemeral_peer_with( let mut shared_secret = classic_mceliece::decapsulate(&cme_kem_secret, cme_ciphertext)?; xor_assign(&mut psk_data, shared_secret.as_array()); - // This should happen automatically due to `SharedSecret` implementing ZeroizeOnDrop. But - // doing it explicitly provides a stronger guarantee that it's not accidentally - // removed. + // This should happen automatically due to `SharedSecret` implementing ZeroizeOnDrop. + // But doing it explicitly provides a stronger guarantee that it's not + // accidentally removed. shared_secret.zeroize(); } // Decapsulate Kyber and mix into PSK diff --git a/talpid-wireguard/src/wireguard_nt/daita.rs b/talpid-wireguard/src/wireguard_nt/daita.rs index 75d6ebaa4d..a088ba7128 100644 --- a/talpid-wireguard/src/wireguard_nt/daita.rs +++ b/talpid-wireguard/src/wireguard_nt/daita.rs @@ -1,13 +1,14 @@ use super::WIREGUARD_KEY_LENGTH; use maybenot::framework::MachineId; use once_cell::sync::OnceCell; -use std::{collections::HashMap, fs, io, path::Path, time::Duration}; -use std::{os::windows::prelude::RawHandle, sync::Arc}; +use std::{ + collections::HashMap, fs, io, os::windows::prelude::RawHandle, path::Path, sync::Arc, + time::Duration, +}; use talpid_types::net::wireguard::PublicKey; use tokio::task::JoinHandle; -use windows_sys::Win32::Foundation::BOOLEAN; use windows_sys::Win32::{ - Foundation::ERROR_NO_MORE_ITEMS, + Foundation::{BOOLEAN, ERROR_NO_MORE_ITEMS}, System::Threading::{WaitForMultipleObjects, WaitForSingleObject, INFINITE}, }; @@ -238,7 +239,8 @@ impl MachineMap { } impl Machinist { - /// Spawn an actor that handles scheduling of Maybenot actions and forwards DAITA events to the framework. + /// Spawn an actor that handles scheduling of Maybenot actions and forwards DAITA events to the + /// framework. pub fn spawn( resource_dir: &Path, daita: Session, diff --git a/test/test-manager/src/tests/split_tunnel.rs b/test/test-manager/src/tests/split_tunnel.rs index 46c0d24e25..435552a460 100644 --- a/test/test-manager/src/tests/split_tunnel.rs +++ b/test/test-manager/src/tests/split_tunnel.rs @@ -2,8 +2,7 @@ use anyhow::Context; use mullvad_management_interface::MullvadProxyClient; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use test_macro::test_function; -use test_rpc::meta::OsVersion; -use test_rpc::ServiceClient; +use test_rpc::{meta::OsVersion, ServiceClient}; use super::{ helpers::{self, ConnChecker}, diff --git a/test/test-runner/src/sys.rs b/test/test-runner/src/sys.rs index 0a176b1c3d..a53396d08f 100644 --- a/test/test-runner/src/sys.rs +++ b/test/test-runner/src/sys.rs @@ -596,7 +596,8 @@ pub async fn get_daemon_environment() -> Result<HashMap<String, String>, test_rp Ok(env) } -/// Parse a systemd env-file. `input` is assumed to be the entire text content of a systemd-env file. +/// Parse a systemd env-file. `input` is assumed to be the entire text content of a systemd-env +/// file. /// /// Example systemd-env file: /// ``` @@ -624,7 +625,8 @@ pub async fn get_daemon_environment() -> Result<HashMap<String, String>, test_rp 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 trim that! + // The Strings will be quoted (surrounded by ") when read from the registry - we should + // trim that! let trim = |string: String| string.trim_matches('"').to_owned(); let env = key .open_subkey("Environment") @@ -661,7 +663,8 @@ pub async fn get_daemon_environment() -> Result<HashMap<String, String>, test_rp .as_dictionary() .ok_or_else(|| test_rpc::Error::Service("plist missing dict".to_owned()))?; let Some(env_vars) = plist_tree.get("EnvironmentVariables") else { - // `EnvironmentVariables` does not exist in plist file, so there are no env variables to parse. + // `EnvironmentVariables` does not exist in plist file, so there are no env variables to + // parse. return Ok(HashMap::new()); }; let env_vars = env_vars.as_dictionary().ok_or_else(|| { |
