diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-05-14 07:47:46 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-05-14 07:47:46 -0300 |
| commit | 692f0c810a3fbb869ac556606384312ac8e60eec (patch) | |
| tree | 106147e4add4e396185b252fbd7e4902cae2ecbe | |
| parent | 2bf6f5c91093493e6a0c38e7933998b68984dd18 (diff) | |
| parent | 28e28d6b8ee47b7d1c69971c0b6e47b4138bf95a (diff) | |
| download | mullvadvpn-692f0c810a3fbb869ac556606384312ac8e60eec.tar.xz mullvadvpn-692f0c810a3fbb869ac556606384312ac8e60eec.zip | |
Merge branch 'fix-warnings-on-windows'
| -rw-r--r-- | Cargo.lock | 1 | ||||
| -rw-r--r-- | mullvad-daemon/src/bin/problem-report.rs | 3 | ||||
| -rw-r--r-- | talpid-core/Cargo.toml | 1 | ||||
| -rw-r--r-- | talpid-core/src/lib.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/tunnel/openvpn.rs | 7 | ||||
| -rw-r--r-- | windows-service/examples/simple_service.rs | 8 |
6 files changed, 10 insertions, 12 deletions
diff --git a/Cargo.lock b/Cargo.lock index b467d6b1e9..1a7c361918 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1359,7 +1359,6 @@ dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc?tag=v8.0.1)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc?tag=v8.0.1)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "notify 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/mullvad-daemon/src/bin/problem-report.rs b/mullvad-daemon/src/bin/problem-report.rs index 666df33c3d..304d572212 100644 --- a/mullvad-daemon/src/bin/problem-report.rs +++ b/mullvad-daemon/src/bin/problem-report.rs @@ -26,7 +26,6 @@ use std::env; use std::fs::File; use std::io::{self, BufWriter, Read, Seek, SeekFrom, Write}; use std::path::{Path, PathBuf}; -use std::process::Command; /// Maximum number of bytes to read from each log file const LOG_MAX_READ_BYTES: usize = 1 * 1024 * 1024; @@ -393,6 +392,8 @@ fn os_version() -> String { /// Helper for getting stdout of some command as a String. Ignores the exit code of the command. #[cfg(any(target_os = "linux", target_os = "macos"))] fn command_stdout_lossy(cmd: &str, args: &[&str]) -> Option<String> { + use std::process::Command; + Command::new(cmd) .args(args) .output() diff --git a/talpid-core/Cargo.toml b/talpid-core/Cargo.toml index c9e4da653c..864368e31f 100644 --- a/talpid-core/Cargo.toml +++ b/talpid-core/Cargo.toml @@ -11,7 +11,6 @@ duct = "0.10" error-chain = "0.11" jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc", tag = "v8.0.1" } jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc", tag = "v8.0.1" } -lazy_static = "1.0" libc = "0.2.20" log = "0.4" uuid = { version = "0.6", features = ["v4"] } diff --git a/talpid-core/src/lib.rs b/talpid-core/src/lib.rs index 6c6e907255..c2939cc762 100644 --- a/talpid-core/src/lib.rs +++ b/talpid-core/src/lib.rs @@ -14,8 +14,6 @@ extern crate atty; extern crate duct; #[macro_use] -extern crate lazy_static; -#[macro_use] extern crate log; #[macro_use] diff --git a/talpid-core/src/tunnel/openvpn.rs b/talpid-core/src/tunnel/openvpn.rs index 90837530cd..55441da6df 100644 --- a/talpid-core/src/tunnel/openvpn.rs +++ b/talpid-core/src/tunnel/openvpn.rs @@ -9,6 +9,7 @@ use std::process::ExitStatus; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{mpsc, Arc}; use std::thread; +#[cfg(unix)] use std::time::Duration; use talpid_ipc; @@ -32,9 +33,7 @@ pub use self::errors::*; #[cfg(unix)] -lazy_static! { - static ref OPENVPN_DIE_TIMEOUT: Duration = Duration::from_secs(2); -} +static OPENVPN_DIE_TIMEOUT: Duration = Duration::from_secs(2); /// Struct for monitoring an OpenVPN process. @@ -214,7 +213,7 @@ impl ProcessHandle for duct::Handle { #[cfg(unix)] fn kill(&self) -> io::Result<()> { use process::unix::HandleKillExt; - self.nice_kill(*OPENVPN_DIE_TIMEOUT) + self.nice_kill(OPENVPN_DIE_TIMEOUT) } #[cfg(not(unix))] diff --git a/windows-service/examples/simple_service.rs b/windows-service/examples/simple_service.rs index 31773519a5..d7b0416466 100644 --- a/windows-service/examples/simple_service.rs +++ b/windows-service/examples/simple_service.rs @@ -15,12 +15,12 @@ // `tail -F C:\Windows\Temp\simple-service.log` // +#[cfg(windows)] #[macro_use] extern crate error_chain; +#[cfg(windows)] #[macro_use] extern crate log; -extern crate simplelog; - #[cfg(windows)] #[macro_use] extern crate windows_service; @@ -37,6 +37,8 @@ fn main() { #[cfg(windows)] mod simple_service { + extern crate simplelog; + use std::ffi::OsString; use std::fs::OpenOptions; use std::path::PathBuf; @@ -45,8 +47,8 @@ mod simple_service { use std::time::Duration; use std::{env, io, thread, time}; + use self::simplelog::{CombinedLogger, Config, WriteLogger}; use log::LevelFilter; - use simplelog::{CombinedLogger, Config, WriteLogger}; use windows_service::service::{ ServiceAccess, ServiceControl, ServiceControlAccept, ServiceErrorControl, ServiceExitCode, |
