diff options
| author | David Lönnhager <david.l@mullvad.net> | 2024-02-19 10:07:28 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2024-02-19 15:28:02 +0100 |
| commit | 07bf94820842bd3a034ca4e9b32641d7ef1c5e78 (patch) | |
| tree | ee442db468190aeccc151ed21749024f04b1b265 | |
| parent | 9c9b384adb6f3b7bc719c3a9f9c56f5ff8da4ceb (diff) | |
| download | mullvadvpn-07bf94820842bd3a034ca4e9b32641d7ef1c5e78.tar.xz mullvadvpn-07bf94820842bd3a034ca4e9b32641d7ef1c5e78.zip | |
Fix redundant imports
| -rw-r--r-- | mullvad-api/src/bin/relay_list.rs | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/exception_logging/unix.rs | 1 | ||||
| -rw-r--r-- | mullvad-daemon/src/geoip.rs | 5 | ||||
| -rw-r--r-- | mullvad-daemon/src/management_interface.rs | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/settings/mod.rs | 1 | ||||
| -rw-r--r-- | mullvad-relay-selector/src/lib.rs | 7 | ||||
| -rw-r--r-- | mullvad-setup/src/main.rs | 2 | ||||
| -rw-r--r-- | mullvad-types/src/version.rs | 5 | ||||
| -rw-r--r-- | mullvad-types/src/wireguard.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/firewall/linux.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/offline/linux.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/split_tunnel/windows/mod.rs | 1 | ||||
| -rw-r--r-- | talpid-core/src/tunnel/mod.rs | 5 | ||||
| -rw-r--r-- | talpid-dbus/src/systemd_resolved.rs | 1 | ||||
| -rw-r--r-- | talpid-openvpn-plugin/src/processing.rs | 5 | ||||
| -rw-r--r-- | talpid-openvpn/src/lib.rs | 8 | ||||
| -rw-r--r-- | talpid-openvpn/src/process/openvpn.rs | 1 | ||||
| -rw-r--r-- | talpid-routing/src/windows/route_manager.rs | 7 | ||||
| -rw-r--r-- | talpid-wireguard/src/connectivity_check.rs | 4 | ||||
| -rw-r--r-- | talpid-wireguard/src/wireguard_kernel/wg_message.rs | 1 | ||||
| -rw-r--r-- | test/test-manager/src/tests/account.rs | 2 |
21 files changed, 13 insertions, 53 deletions
diff --git a/mullvad-api/src/bin/relay_list.rs b/mullvad-api/src/bin/relay_list.rs index 8cb615d77f..def32303ea 100644 --- a/mullvad-api/src/bin/relay_list.rs +++ b/mullvad-api/src/bin/relay_list.rs @@ -2,7 +2,7 @@ //! Used by the installer artifact packer to bundle the latest available //! relay list at the time of creating the installer. -use mullvad_api::{self, proxy::ApiConnectionMode, rest::Error as RestError, RelayListProxy}; +use mullvad_api::{proxy::ApiConnectionMode, rest::Error as RestError, RelayListProxy}; use std::process; use talpid_types::ErrorExt; diff --git a/mullvad-daemon/src/exception_logging/unix.rs b/mullvad-daemon/src/exception_logging/unix.rs index 45948224b9..36d1f679dd 100644 --- a/mullvad-daemon/src/exception_logging/unix.rs +++ b/mullvad-daemon/src/exception_logging/unix.rs @@ -4,7 +4,6 @@ use libc::siginfo_t; use nix::sys::signal::{sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal}; use std::{ - convert::TryFrom, ffi::{c_int, c_void}, sync::Once, }; diff --git a/mullvad-daemon/src/geoip.rs b/mullvad-daemon/src/geoip.rs index 14e46a914b..af7db0cb2b 100644 --- a/mullvad-daemon/src/geoip.rs +++ b/mullvad-daemon/src/geoip.rs @@ -1,10 +1,7 @@ use std::time::Duration; use futures::join; -use mullvad_api::{ - self, - rest::{Error, RequestServiceHandle}, -}; +use mullvad_api::rest::{Error, RequestServiceHandle}; use mullvad_types::location::{AmIMullvad, GeoIpLocation, LocationEventData}; use once_cell::sync::Lazy; use talpid_core::mpsc::Sender; diff --git a/mullvad-daemon/src/management_interface.rs b/mullvad-daemon/src/management_interface.rs index 1c003018a5..41736f3f38 100644 --- a/mullvad-daemon/src/management_interface.rs +++ b/mullvad-daemon/src/management_interface.rs @@ -8,7 +8,6 @@ use mullvad_management_interface::{ types::{self, daemon_event, management_service_server::ManagementService}, Code, Request, Response, Status, }; -use mullvad_paths; #[cfg(not(target_os = "android"))] use mullvad_types::settings::DnsOptions; use mullvad_types::{ @@ -25,7 +24,6 @@ use mullvad_types::{ #[cfg(windows)] use std::path::PathBuf; use std::{ - convert::{TryFrom, TryInto}, str::FromStr, sync::{Arc, Mutex}, time::Duration, diff --git a/mullvad-daemon/src/settings/mod.rs b/mullvad-daemon/src/settings/mod.rs index d411bce2b4..4cae48a24f 100644 --- a/mullvad-daemon/src/settings/mod.rs +++ b/mullvad-daemon/src/settings/mod.rs @@ -476,7 +476,6 @@ impl<'a> SettingsSummary<'a> { mod test { use super::*; use mullvad_types::settings::SettingsVersion; - use serde_json; #[test] #[should_panic] diff --git a/mullvad-relay-selector/src/lib.rs b/mullvad-relay-selector/src/lib.rs index ac0da9f9b3..f006dea56e 100644 --- a/mullvad-relay-selector/src/lib.rs +++ b/mullvad-relay-selector/src/lib.rs @@ -1330,12 +1330,9 @@ impl NormalSelectedRelay { mod test { use super::*; use mullvad_types::{ - custom_list::CustomListsSettings, - relay_constraints::{ - GeographicLocationConstraint, RelayConstraints, RelaySettings, WireguardConstraints, - }, + relay_constraints::{GeographicLocationConstraint, WireguardConstraints}, relay_list::{ - OpenVpnEndpoint, OpenVpnEndpointData, Relay, RelayListCity, RelayListCountry, + OpenVpnEndpoint, OpenVpnEndpointData, RelayListCity, RelayListCountry, ShadowsocksEndpointData, WireguardEndpointData, WireguardRelayEndpointData, }, }; diff --git a/mullvad-setup/src/main.rs b/mullvad-setup/src/main.rs index e361d41a2b..6155f0eaa9 100644 --- a/mullvad-setup/src/main.rs +++ b/mullvad-setup/src/main.rs @@ -2,7 +2,7 @@ use clap::Parser; use once_cell::sync::Lazy; use std::{path::PathBuf, process, str::FromStr, time::Duration}; -use mullvad_api::{self, proxy::ApiConnectionMode, DEVICE_NOT_FOUND}; +use mullvad_api::{proxy::ApiConnectionMode, DEVICE_NOT_FOUND}; use mullvad_management_interface::MullvadProxyClient; use mullvad_types::version::ParsedAppVersion; use talpid_core::firewall::{self, Firewall}; diff --git a/mullvad-types/src/version.rs b/mullvad-types/src/version.rs index b82499f02c..02b47b3dc3 100644 --- a/mullvad-types/src/version.rs +++ b/mullvad-types/src/version.rs @@ -3,10 +3,7 @@ use jnix::IntoJava; use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; -use std::{ - cmp::{Ord, Ordering, PartialOrd}, - str::FromStr, -}; +use std::{cmp::Ordering, 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/mullvad-types/src/wireguard.rs b/mullvad-types/src/wireguard.rs index 2bbce9bb2b..db1d44f4d5 100644 --- a/mullvad-types/src/wireguard.rs +++ b/mullvad-types/src/wireguard.rs @@ -3,7 +3,7 @@ use chrono::{offset::Utc, DateTime}; #[cfg(target_os = "android")] use jnix::{FromJava, IntoJava}; use serde::{Deserialize, Deserializer, Serialize}; -use std::{convert::TryFrom, fmt, str::FromStr, time::Duration}; +use std::{fmt, str::FromStr, time::Duration}; use talpid_types::net::wireguard; pub const MIN_ROTATION_INTERVAL: Duration = Duration::from_secs(1 * 24 * 60 * 60); diff --git a/talpid-core/src/firewall/linux.rs b/talpid-core/src/firewall/linux.rs index 79ac00fc8d..717945c649 100644 --- a/talpid-core/src/firewall/linux.rs +++ b/talpid-core/src/firewall/linux.rs @@ -1,9 +1,7 @@ use super::{FirewallArguments, FirewallPolicy}; use crate::{split_tunnel, tunnel}; use ipnetwork::IpNetwork; -use libc; use nftnl::{ - self, expr::{self, IcmpCode, Payload, RejectionType, Verdict}, nft_expr, table, Batch, Chain, FinalizedBatch, ProtoFamily, Rule, Table, }; diff --git a/talpid-core/src/offline/linux.rs b/talpid-core/src/offline/linux.rs index 9f76a19591..6f37ef89e9 100644 --- a/talpid-core/src/offline/linux.rs +++ b/talpid-core/src/offline/linux.rs @@ -3,7 +3,7 @@ use std::{ net::{IpAddr, Ipv4Addr, Ipv6Addr}, sync::Arc, }; -use talpid_routing::{self, RouteManagerHandle}; +use talpid_routing::RouteManagerHandle; use talpid_types::{net::Connectivity, ErrorExt}; pub type Result<T> = std::result::Result<T, Error>; diff --git a/talpid-core/src/split_tunnel/windows/mod.rs b/talpid-core/src/split_tunnel/windows/mod.rs index e168ad38ae..c5b08706ff 100644 --- a/talpid-core/src/split_tunnel/windows/mod.rs +++ b/talpid-core/src/split_tunnel/windows/mod.rs @@ -8,7 +8,6 @@ use crate::{tunnel::TunnelMetadata, tunnel_state_machine::TunnelCommand}; use futures::channel::{mpsc, oneshot}; use std::{ collections::HashMap, - convert::TryFrom, ffi::{OsStr, OsString}, io, net::{IpAddr, Ipv4Addr, Ipv6Addr}, diff --git a/talpid-core/src/tunnel/mod.rs b/talpid-core/src/tunnel/mod.rs index b7b4abd747..3ef05201b5 100644 --- a/talpid-core/src/tunnel/mod.rs +++ b/talpid-core/src/tunnel/mod.rs @@ -3,17 +3,12 @@ use crate::logging; use futures::channel::oneshot; use std::path; #[cfg(not(target_os = "android"))] -use talpid_openvpn; -#[cfg(not(target_os = "android"))] use talpid_routing::RouteManagerHandle; pub use talpid_tunnel::{TunnelArgs, TunnelEvent, TunnelMetadata}; #[cfg(not(target_os = "android"))] use talpid_types::net::openvpn as openvpn_types; use talpid_types::net::{wireguard as wireguard_types, TunnelParameters}; -/// A module for all WireGuard related tunnel management. -use talpid_wireguard; - const OPENVPN_LOG_FILENAME: &str = "openvpn.log"; const WIREGUARD_LOG_FILENAME: &str = "wireguard.log"; diff --git a/talpid-dbus/src/systemd_resolved.rs b/talpid-dbus/src/systemd_resolved.rs index 0fe1a1a211..51de941990 100644 --- a/talpid-dbus/src/systemd_resolved.rs +++ b/talpid-dbus/src/systemd_resolved.rs @@ -1,5 +1,4 @@ use dbus::{ - self, arg::{self, RefArg}, blocking::{ stdintf::org_freedesktop_dbus::{Properties, PropertiesPropertiesChanged}, diff --git a/talpid-openvpn-plugin/src/processing.rs b/talpid-openvpn-plugin/src/processing.rs index 0f3c869446..8ef6c337e9 100644 --- a/talpid-openvpn-plugin/src/processing.rs +++ b/talpid-openvpn-plugin/src/processing.rs @@ -3,10 +3,7 @@ use parity_tokio_ipc::Endpoint as IpcEndpoint; use std::collections::HashMap; use tower::service_fn; -use tonic::{ - self, - transport::{Endpoint, Uri}, -}; +use tonic::transport::{Endpoint, Uri}; use tokio::runtime::{self, Runtime}; diff --git a/talpid-openvpn/src/lib.rs b/talpid-openvpn/src/lib.rs index 1cd58bdf11..8bb09549d8 100644 --- a/talpid-openvpn/src/lib.rs +++ b/talpid-openvpn/src/lib.rs @@ -18,7 +18,7 @@ use std::{ time::Duration, }; #[cfg(target_os = "linux")] -use talpid_routing::{self, RequiredRoute}; +use talpid_routing::RequiredRoute; use talpid_tunnel::TunnelEvent; use talpid_types::{ net::{openvpn, proxy::CustomProxy}, @@ -780,7 +780,6 @@ mod event_server { use talpid_types::{net::proxy::CustomProxy, ErrorExt}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tonic::{ - self, transport::{server::Connected, Server}, Request, Response, }; @@ -1090,10 +1089,7 @@ mod event_server { mod tests { use super::*; use crate::mktemp::TempFile; - use std::{ - path::{Path, PathBuf}, - sync::{Arc, Mutex}, - }; + use std::sync::{Arc, Mutex}; #[cfg(windows)] #[derive(Debug)] diff --git a/talpid-openvpn/src/process/openvpn.rs b/talpid-openvpn/src/process/openvpn.rs index c45c2c0a90..7a96a7d732 100644 --- a/talpid-openvpn/src/process/openvpn.rs +++ b/talpid-openvpn/src/process/openvpn.rs @@ -1,5 +1,4 @@ use futures::channel::oneshot; -use shell_escape; use std::{ ffi::{OsStr, OsString}, fmt, io, diff --git a/talpid-routing/src/windows/route_manager.rs b/talpid-routing/src/windows/route_manager.rs index f0fa53126b..60ef984d08 100644 --- a/talpid-routing/src/windows/route_manager.rs +++ b/talpid-routing/src/windows/route_manager.rs @@ -38,7 +38,6 @@ use windows_sys::Win32::{ }; type Network = IpNetwork; -type NodeAddress = SOCKADDR_INET; /// Callback handle for the default route changed callback. Produced by the RouteManager. pub struct CallbackHandle { @@ -84,12 +83,6 @@ impl PartialEq for RegisteredRoute { } #[derive(Clone)] -pub struct Node { - pub device_name: Option<widestring::U16CString>, - pub gateway: Option<NodeAddress>, -} - -#[derive(Clone)] pub struct Route { pub network: Network, pub node: NetNode, diff --git a/talpid-wireguard/src/connectivity_check.rs b/talpid-wireguard/src/connectivity_check.rs index a7b09778d9..3a8208400e 100644 --- a/talpid-wireguard/src/connectivity_check.rs +++ b/talpid-wireguard/src/connectivity_check.rs @@ -394,15 +394,13 @@ mod test { use crate::{ config::Config, stats::{self, Stats}, - TunnelError, }; use std::{ pin::Pin, sync::{ atomic::{AtomicBool, Ordering}, - Arc, Mutex, + Arc, }, - time::{Duration, Instant}, }; /// Test if a newly created ConnState won't have timed out or consider itself connected diff --git a/talpid-wireguard/src/wireguard_kernel/wg_message.rs b/talpid-wireguard/src/wireguard_kernel/wg_message.rs index 4dc84ed503..6dd3ea88a5 100644 --- a/talpid-wireguard/src/wireguard_kernel/wg_message.rs +++ b/talpid-wireguard/src/wireguard_kernel/wg_message.rs @@ -61,7 +61,6 @@ mod constants { } use constants::*; -pub use constants::{WG_CMD_GET_DEVICE, WG_CMD_SET_DEVICE}; type PrivateKey = [u8; 32]; type PublicKey = [u8; 32]; diff --git a/test/test-manager/src/tests/account.rs b/test/test-manager/src/tests/account.rs index 56bcadafbd..60c61a78ff 100644 --- a/test/test-manager/src/tests/account.rs +++ b/test/test-manager/src/tests/account.rs @@ -1,7 +1,7 @@ use super::config::TEST_CONFIG; use super::{helpers, ui, Error, TestContext}; use mullvad_api::DevicesProxy; -use mullvad_management_interface::{self, client::DaemonEvent, MullvadProxyClient}; +use mullvad_management_interface::{client::DaemonEvent, MullvadProxyClient}; use mullvad_types::device::{Device, DeviceState}; use mullvad_types::states::TunnelState; use std::net::ToSocketAddrs; |
