Skip to content

Commit b38aa02

Browse files
authored
Merge pull request #37 from alexanderkjall/replace-tempdir-with-tempfile
Replace tempdir with tempfile
2 parents 4767637 + e5f5f3a commit b38aa02

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ libc = "0.2.50"
1717
[dev-dependencies]
1818
futures = "0.1"
1919
num_cpus = "1.0"
20-
tempdir = "0.3"
20+
tempfile = "3"
2121
tokio-core = "0.1"
2222
tokio-process = "0.2"
2323

tests/client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::thread;
1010
use futures::future::{self, Future};
1111
use futures::stream::{self, Stream};
1212
use jobserver::Client;
13-
use tempdir::TempDir;
1413
use tokio_core::reactor::Core;
1514
use tokio_process::CommandExt;
1615

@@ -128,7 +127,7 @@ fn main() {
128127
None => true,
129128
})
130129
.map(|test| {
131-
let td = t!(TempDir::new("foo"));
130+
let td = t!(tempfile::tempdir());
132131
let makefile = format!(
133132
"\
134133
all: export TEST_TO_RUN={}

tests/make-as-a-client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::net::{TcpListener, TcpStream};
55
use std::process::Command;
66

77
use jobserver::Client;
8-
use tempdir::TempDir;
98

109
macro_rules! t {
1110
($e:expr) => {
@@ -37,7 +36,7 @@ fn main() {
3736
}
3837

3938
let c = t!(Client::new(1));
40-
let td = TempDir::new("foo").unwrap();
39+
let td = tempfile::tempdir().unwrap();
4140

4241
let prog = env::var("MAKE").unwrap_or_else(|_| "make".to_string());
4342

tests/server.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::sync::Arc;
88
use std::thread;
99

1010
use jobserver::Client;
11-
use tempdir::TempDir;
1211

1312
macro_rules! t {
1413
($e:expr) => {
@@ -56,7 +55,7 @@ fn server_blocks() {
5655
#[test]
5756
fn make_as_a_single_thread_client() {
5857
let c = t!(Client::new(1));
59-
let td = TempDir::new("foo").unwrap();
58+
let td = tempfile::tempdir().unwrap();
6059

6160
let prog = env::var("MAKE").unwrap_or_else(|_| "make".to_string());
6261
let mut cmd = Command::new(prog);
@@ -110,7 +109,7 @@ foo
110109
#[test]
111110
fn make_as_a_multi_thread_client() {
112111
let c = t!(Client::new(1));
113-
let td = TempDir::new("foo").unwrap();
112+
let td = tempfile::tempdir().unwrap();
114113

115114
let prog = env::var("MAKE").unwrap_or_else(|_| "make".to_string());
116115
let mut cmd = Command::new(prog);

0 commit comments

Comments
 (0)