diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2018-06-11 15:27:54 +0100 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2018-06-11 15:27:54 +0100 |
| commit | 2fc0f0ff1ba9f662f4d933bc02bfa5a74dbaf11a (patch) | |
| tree | 1160d9753ad6eb2282a824499c65dbb625ca858d | |
| parent | f1223c4f7b94b4f5030705224219e24b7e594f37 (diff) | |
| parent | 321b1b0eb60be2a143b6ce8b44adbaae99fada65 (diff) | |
| download | mullvadvpn-2fc0f0ff1ba9f662f4d933bc02bfa5a74dbaf11a.tar.xz mullvadvpn-2fc0f0ff1ba9f662f4d933bc02bfa5a74dbaf11a.zip | |
Merge branch 'move-to-tempfile'
| -rw-r--r-- | Cargo.lock | 15 | ||||
| -rw-r--r-- | mullvad-rpc/Cargo.toml | 2 | ||||
| -rw-r--r-- | mullvad-rpc/src/cached_dns_resolver.rs | 6 |
3 files changed, 18 insertions, 5 deletions
diff --git a/Cargo.lock b/Cargo.lock index efba8d2afc..4e10aabed4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -821,7 +821,7 @@ dependencies = [ "mullvad-types 0.1.0", "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1442,6 +1442,18 @@ dependencies = [ ] [[package]] +name = "tempfile" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "termcolor" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1991,6 +2003,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum system-configuration-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d8b463ff8bb4585b46e3e23f44dd41b3f52d0ad09b6b9cf03aae55c74d74cff" "checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +"checksum tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47776f63b85777d984a50ce49d6b9e58826b6a3766a449fc95bc66cd5663c15b" "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" diff --git a/mullvad-rpc/Cargo.toml b/mullvad-rpc/Cargo.toml index e62505dd2e..caf2e2db48 100644 --- a/mullvad-rpc/Cargo.toml +++ b/mullvad-rpc/Cargo.toml @@ -25,4 +25,4 @@ mullvad-types = { path = "../mullvad-types" } [dev-dependencies] filetime = "0.1" -tempdir = "0.3" +tempfile = "3.0" diff --git a/mullvad-rpc/src/cached_dns_resolver.rs b/mullvad-rpc/src/cached_dns_resolver.rs index 69276c0348..67d4f6bcd6 100644 --- a/mullvad-rpc/src/cached_dns_resolver.rs +++ b/mullvad-rpc/src/cached_dns_resolver.rs @@ -206,7 +206,7 @@ impl<R: DnsResolver> CachedDnsResolver<R> { #[cfg(test)] mod tests { extern crate filetime; - extern crate tempdir; + extern crate tempfile; use std::fs::{self, File}; use std::io::{Read, Write}; @@ -214,7 +214,7 @@ mod tests { use std::sync::Arc; use self::filetime::FileTime; - use self::tempdir::TempDir; + use self::tempfile::TempDir; use super::*; #[test] @@ -356,7 +356,7 @@ mod tests { } fn create_test_dirs() -> (TempDir, PathBuf) { - let temp_dir = TempDir::new("ip-cache-test").unwrap(); + let temp_dir = TempDir::new().expect("Failed to create a temporary cache directory"); let cache_dir = temp_dir.path().join("cache"); fs::create_dir(&cache_dir).unwrap(); |
