summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2024-11-28 15:49:24 +0100
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-11-28 16:47:56 +0100
commit5e51c78abb8ff29bb75b4196189a777f0e3ea8f9 (patch)
tree96671db0aeb96d4e6089ae2db7435bc8c30d77b0
parent51699c6714f0d6d4d1c73330ab9bc589eee7cb14 (diff)
downloadmullvadvpn-5e51c78abb8ff29bb75b4196189a777f0e3ea8f9.tar.xz
mullvadvpn-5e51c78abb8ff29bb75b4196189a777f0e3ea8f9.zip
Fix clippy warnings
-rw-r--r--mullvad-cli/src/cmds/relay.rs1
-rw-r--r--mullvad-daemon/src/macos_launch_daemon.rs4
-rw-r--r--mullvad-daemon/src/migrations/v7.rs2
-rw-r--r--talpid-wireguard/src/wireguard_nt/mod.rs61
4 files changed, 15 insertions, 53 deletions
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs
index 4fe11b2a8f..d0de98c27a 100644
--- a/mullvad-cli/src/cmds/relay.rs
+++ b/mullvad-cli/src/cmds/relay.rs
@@ -396,7 +396,6 @@ impl Relay {
}
/// Get active relays which are not bridges.
-
async fn update_constraints(update_fn: impl FnOnce(&mut RelayConstraints)) -> Result<()> {
let mut rpc = MullvadProxyClient::new().await?;
let settings = rpc.get_settings().await?;
diff --git a/mullvad-daemon/src/macos_launch_daemon.rs b/mullvad-daemon/src/macos_launch_daemon.rs
index 3e10d94ce7..945e61828b 100644
--- a/mullvad-daemon/src/macos_launch_daemon.rs
+++ b/mullvad-daemon/src/macos_launch_daemon.rs
@@ -78,9 +78,7 @@ fn daemon_plist_url() -> Object {
/// Path to the plist that defines the Mullvad launch daemon.
/// It must be kept in sync with the path defined in
/// `dist-assets/pkg-scripts/postinstall`.
- const DAEMON_PLIST_PATH: &CStr = unsafe {
- CStr::from_bytes_with_nul_unchecked(b"/Library/LaunchDaemons/net.mullvad.daemon.plist\0")
- };
+ const DAEMON_PLIST_PATH: &CStr = c"/Library/LaunchDaemons/net.mullvad.daemon.plist";
let nsstr_inst: Id = unsafe { msg_send![class!(NSString), alloc] };
let nsstr_inst: Id =
diff --git a/mullvad-daemon/src/migrations/v7.rs b/mullvad-daemon/src/migrations/v7.rs
index 56225aa7b0..47c6bf6275 100644
--- a/mullvad-daemon/src/migrations/v7.rs
+++ b/mullvad-daemon/src/migrations/v7.rs
@@ -66,7 +66,7 @@ pub struct ShadowsocksProxySettings {
}
// ======================================================
-/// This is a closed migration.
+// This is a closed migration.
/// We change bridge settings to no longer be an enum with custom and normal variants. It now is a
/// struct which contains a bridge type, a normal relay constraint and optional custom constraints.
diff --git a/talpid-wireguard/src/wireguard_nt/mod.rs b/talpid-wireguard/src/wireguard_nt/mod.rs
index 35937bcb8c..fefb7879e9 100644
--- a/talpid-wireguard/src/wireguard_nt/mod.rs
+++ b/talpid-wireguard/src/wireguard_nt/mod.rs
@@ -714,80 +714,45 @@ impl WgNtDll {
Ok(WgNtDll {
handle,
func_create: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardCreateAdapter\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardCreateAdapter")?) as *const _ as *const _)
},
func_close: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardCloseAdapter\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardCloseAdapter")?) as *const _ as *const _)
},
func_get_adapter_luid: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardGetAdapterLUID\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardGetAdapterLUID")?) as *const _ as *const _)
},
func_set_configuration: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardSetConfiguration\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardSetConfiguration")?) as *const _ as *const _)
},
func_get_configuration: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardGetConfiguration\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardGetConfiguration")?) as *const _ as *const _)
},
func_set_adapter_state: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardSetAdapterState\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardSetAdapterState")?) as *const _ as *const _)
},
func_set_logger: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardSetLogger\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardSetLogger")?) as *const _ as *const _)
},
func_set_adapter_logging: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardSetAdapterLogging\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardSetAdapterLogging")?) as *const _ as *const _)
},
#[cfg(daita)]
func_daita_activate: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardDaitaActivate\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardDaitaActivate")?) as *const _ as *const _)
},
#[cfg(daita)]
func_daita_event_data_available_event: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardDaitaEventDataAvailableEvent\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardDaitaEventDataAvailableEvent")?) as *const _
+ as *const _)
},
#[cfg(daita)]
func_daita_receive_events: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardDaitaReceiveEvents\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardDaitaReceiveEvents")?) as *const _ as *const _)
},
#[cfg(daita)]
func_daita_send_action: unsafe {
- *((&get_proc_fn(
- handle,
- CStr::from_bytes_with_nul(b"WireGuardDaitaSendAction\0").unwrap(),
- )?) as *const _ as *const _)
+ *((&get_proc_fn(handle, c"WireGuardDaitaSendAction")?) as *const _ as *const _)
},
})
}