summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2019-01-18 18:08:57 +0100
committerLinus Färnstrand <linus@mullvad.net>2019-01-18 18:20:41 +0100
commit4600484823c365a19583069984a83078c58403d2 (patch)
treed4408ece411417070eb69d41689ce538dbb28fc4
parent1cac24bdad9e9d412f8c8b28b08212f5ea631f8d (diff)
downloadmullvadvpn-4600484823c365a19583069984a83078c58403d2.tar.xz
mullvadvpn-4600484823c365a19583069984a83078c58403d2.zip
Fix import path errors
-rw-r--r--mullvad-daemon/src/system_service.rs4
-rw-r--r--talpid-core/src/offline/macos.rs2
-rw-r--r--talpid-core/src/offline/windows.rs2
-rw-r--r--talpid-core/src/security/windows/mod.rs14
-rw-r--r--talpid-core/src/tunnel/mod.rs6
-rw-r--r--talpid-core/src/tunnel/openvpn.rs24
6 files changed, 26 insertions, 26 deletions
diff --git a/mullvad-daemon/src/system_service.rs b/mullvad-daemon/src/system_service.rs
index 64e49d8e77..bc82944fc9 100644
--- a/mullvad-daemon/src/system_service.rs
+++ b/mullvad-daemon/src/system_service.rs
@@ -1,4 +1,4 @@
-use cli;
+use crate::cli;
use error_chain::ChainedError;
use std::{
env,
@@ -73,7 +73,7 @@ fn run_service() -> Result<()> {
.unwrap();
let config = cli::get_config();
- let result = ::create_daemon(&config).and_then(|daemon| {
+ let result = crate::create_daemon(&config).and_then(|daemon| {
let shutdown_handle = daemon.shutdown_handle();
// Register monitor that translates `ServiceControl` to Daemon events
diff --git a/talpid-core/src/offline/macos.rs b/talpid-core/src/offline/macos.rs
index bf5a269160..0153357f18 100644
--- a/talpid-core/src/offline/macos.rs
+++ b/talpid-core/src/offline/macos.rs
@@ -1,3 +1,4 @@
+use crate::tunnel_state_machine::TunnelCommand;
use futures::sync::mpsc::UnboundedSender;
use log::{debug, trace};
use std::{sync::mpsc, thread};
@@ -9,7 +10,6 @@ use system_configuration::{
},
dynamic_store::{SCDynamicStore, SCDynamicStoreBuilder, SCDynamicStoreCallBackContext},
};
-use tunnel_state_machine::TunnelCommand;
const PRIMARY_INTERFACE_KEY: &str = "State:/Network/Global/IPv4";
diff --git a/talpid-core/src/offline/windows.rs b/talpid-core/src/offline/windows.rs
index 0b798e1d36..5a385c61bf 100644
--- a/talpid-core/src/offline/windows.rs
+++ b/talpid-core/src/offline/windows.rs
@@ -6,6 +6,7 @@
//! GNU General Public License as published by the Free Software Foundation, either version 3 of
//! the License, or (at your option) any later version.
+use crate::tunnel_state_machine::TunnelCommand;
use futures::sync::mpsc::UnboundedSender;
use log::debug;
use std::{
@@ -15,7 +16,6 @@ use std::{
ptr, thread,
time::Duration,
};
-use tunnel_state_machine::TunnelCommand;
use winapi::{
shared::{
basetsd::LONG_PTR,
diff --git a/talpid-core/src/security/windows/mod.rs b/talpid-core/src/security/windows/mod.rs
index e8125c8b80..1a021d593a 100644
--- a/talpid-core/src/security/windows/mod.rs
+++ b/talpid-core/src/security/windows/mod.rs
@@ -1,13 +1,12 @@
use std::{net::IpAddr, ptr};
+use self::winfw::*;
+use super::{NetworkSecurityT, SecurityPolicy};
+use crate::winnet;
use log::{debug, error, trace};
use talpid_types::net::Endpoint;
use widestring::WideCString;
-use self::winfw::*;
-use super::{NetworkSecurityT, SecurityPolicy};
-use winnet;
-
#[macro_use]
mod ffi;
@@ -144,7 +143,7 @@ impl NetworkSecurity {
&mut self,
endpoint: &Endpoint,
winfw_settings: &WinFwSettings,
- tunnel_metadata: &::tunnel::TunnelMetadata,
+ tunnel_metadata: &crate::tunnel::TunnelMetadata,
) -> Result<()> {
trace!("Applying 'connected' firewall policy");
let ip_str = Self::widestring_ip(&endpoint.address.ip());
@@ -189,12 +188,11 @@ impl NetworkSecurity {
#[allow(non_snake_case)]
mod winfw {
+ use super::{ErrorKind, Result};
+ use crate::winnet;
use libc;
use talpid_types::net::TransportProtocol;
- use super::{ErrorKind, Result};
- use winnet;
-
#[repr(C)]
pub struct WinFwRelay {
pub ip: *const libc::wchar_t,
diff --git a/talpid-core/src/tunnel/mod.rs b/talpid-core/src/tunnel/mod.rs
index 8461855954..4011db3e84 100644
--- a/talpid-core/src/tunnel/mod.rs
+++ b/talpid-core/src/tunnel/mod.rs
@@ -1,7 +1,7 @@
use std::{
collections::HashMap,
ffi::OsString,
- fs, io,
+ io,
net::IpAddr,
path::{Path, PathBuf},
};
@@ -291,7 +291,7 @@ fn is_ipv6_enabled_in_os() -> bool {
(ipv6_disabled_bits & IPV6_DISABLED_ON_TUNNELS_MASK) == 0
})
.unwrap_or(true);
- let enabled_on_tap = ::winnet::get_tap_interface_ipv6_status().unwrap_or(false);
+ let enabled_on_tap = crate::winnet::get_tap_interface_ipv6_status().unwrap_or(false);
if !globally_enabled {
log::debug!("IPv6 disabled in tunnel interfaces");
@@ -304,7 +304,7 @@ fn is_ipv6_enabled_in_os() -> bool {
}
#[cfg(target_os = "linux")]
{
- fs::read_to_string("/proc/sys/net/ipv6/conf/all/disable_ipv6")
+ std::fs::read_to_string("/proc/sys/net/ipv6/conf/all/disable_ipv6")
.map(|disable_ipv6| disable_ipv6.trim() == "0")
.unwrap_or(false)
}
diff --git a/talpid-core/src/tunnel/openvpn.rs b/talpid-core/src/tunnel/openvpn.rs
index 22cd11ee95..fadb035966 100644
--- a/talpid-core/src/tunnel/openvpn.rs
+++ b/talpid-core/src/tunnel/openvpn.rs
@@ -1,9 +1,13 @@
use super::TunnelEvent;
-use crate::process::{
- openvpn::{OpenVpnCommand, OpenVpnProcHandle},
- stoppable_process::StoppableProcess,
+use crate::{
+ mktemp,
+ process::{
+ openvpn::{OpenVpnCommand, OpenVpnProcHandle},
+ stoppable_process::StoppableProcess,
+ },
};
-use mktemp;
+#[cfg(target_os = "linux")]
+use failure::ResultExt as FailureResultExt;
use std::{
collections::HashMap,
ffi::OsString,
@@ -20,9 +24,6 @@ use std::{
};
use talpid_ipc;
use talpid_types::net::{Endpoint, OpenVpnProxySettings, TunnelOptions};
-
-#[cfg(target_os = "linux")]
-use failure::ResultExt as FailureResultExt;
#[cfg(target_os = "linux")]
use which;
@@ -526,10 +527,11 @@ mod event_server {
#[cfg(test)]
mod tests {
use super::*;
- use std::path::{Path, PathBuf};
-
- use mktemp::TempFile;
- use std::sync::{Arc, Mutex};
+ use crate::mktemp::TempFile;
+ use std::{
+ path::{Path, PathBuf},
+ sync::{Arc, Mutex},
+ };
#[derive(Debug, Default, Clone)]
struct TestOpenVpnBuilder {