diff options
| -rw-r--r-- | mullvad-problem-report/Cargo.toml | 1 | ||||
| -rw-r--r-- | mullvad-problem-report/build.rs | 9 | ||||
| -rw-r--r-- | mullvad-problem-report/src/main.rs | 19 | ||||
| -rw-r--r-- | mullvad-problem-report/src/metadata.rs | 7 |
4 files changed, 8 insertions, 28 deletions
diff --git a/mullvad-problem-report/Cargo.toml b/mullvad-problem-report/Cargo.toml index 7dd510d4ea..4dbf879370 100644 --- a/mullvad-problem-report/Cargo.toml +++ b/mullvad-problem-report/Cargo.toml @@ -11,6 +11,7 @@ authors = [ ] description = "Collect Mullvad VPN logs into a report and send it to support" license = "GPL-3.0" +edition = "2018" [[bin]] name = "problem-report" diff --git a/mullvad-problem-report/build.rs b/mullvad-problem-report/build.rs index e806ed4361..93e8577394 100644 --- a/mullvad-problem-report/build.rs +++ b/mullvad-problem-report/build.rs @@ -1,11 +1,4 @@ -use std::env; -use std::fs; -use std::path::PathBuf; - -#[cfg(windows)] -extern crate winapi; -#[cfg(windows)] -extern crate winres; +use std::{env, fs, path::PathBuf}; fn main() { let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); diff --git a/mullvad-problem-report/src/main.rs b/mullvad-problem-report/src/main.rs index be288aaf53..6c9fad194a 100644 --- a/mullvad-problem-report/src/main.rs +++ b/mullvad-problem-report/src/main.rs @@ -6,25 +6,13 @@ //! GNU General Public License as published by the Free Software Foundation, either version 3 of //! the License, or (at your option) any later version. -extern crate clap; -extern crate dirs; #[macro_use] extern crate error_chain; -extern crate env_logger; -extern crate lazy_static; -extern crate regex; -extern crate tokio_core; -extern crate uuid; - -extern crate mullvad_paths; -extern crate mullvad_rpc; use clap::crate_authors; use error_chain::ChainedError; use lazy_static::lazy_static; use regex::Regex; -use tokio_core::reactor::Core; - use std::{ alloc::System, borrow::Cow, @@ -35,6 +23,7 @@ use std::{ io::{self, BufWriter, Read, Seek, SeekFrom, Write}, path::{Path, PathBuf}, }; +use tokio_core::reactor::Core; #[global_allocator] @@ -343,21 +332,21 @@ impl ProblemReport { self.redact_custom_strings(&out3).to_string() } - fn redact_account_number(input: &str) -> Cow<str> { + fn redact_account_number(input: &str) -> Cow<'_, str> { lazy_static! { static ref RE: Regex = Regex::new("\\d{16}").unwrap(); } RE.replace_all(input, "[REDACTED ACCOUNT NUMBER]") } - fn redact_home_dir(input: &str) -> Cow<str> { + fn redact_home_dir(input: &str) -> Cow<'_, str> { match dirs::home_dir() { Some(home) => Cow::from(input.replace(home.to_string_lossy().as_ref(), "~")), None => Cow::from(input), } } - fn redact_network_info(input: &str) -> Cow<str> { + fn redact_network_info(input: &str) -> Cow<'_, str> { lazy_static! { static ref RE: Regex = { let boundary = "[^0-9a-zA-Z.:]"; diff --git a/mullvad-problem-report/src/metadata.rs b/mullvad-problem-report/src/metadata.rs index cddbe57892..92de1940e1 100644 --- a/mullvad-problem-report/src/metadata.rs +++ b/mullvad-problem-report/src/metadata.rs @@ -1,6 +1,5 @@ -use std::collections::HashMap; -use std::process::Command; -use uuid; +use std::{collections::HashMap, process::Command}; + pub const PRODUCT_VERSION: &str = include_str!(concat!(env!("OUT_DIR"), "/product-version.txt")); @@ -17,8 +16,6 @@ pub fn collect() -> HashMap<String, String> { #[cfg(target_os = "linux")] mod os { - extern crate rs_release; - pub fn version() -> String { // The OS version information is obtained first from the os-release file. If that // information is incomplete or unavailable, an attempt is made to obtain the |
