Skip to content

Commit 661800e

Browse files
silwolalexcrichton
authored andcommitted
Migrate tests to tempfile from deprecated tempdir (#457)
1 parent 1b97bc6 commit 661800e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobserver = { version = "0.1.16", optional = true }
2525
parallel = ["num_cpus", "jobserver"]
2626

2727
[dev-dependencies]
28-
tempdir = "0.3"
28+
tempfile = "3"

tests/support/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::io::prelude::*;
88
use std::path::{Path, PathBuf};
99

1010
use cc;
11-
use tempdir::TempDir;
11+
use tempfile::{Builder, TempDir};
1212

1313
pub struct Test {
1414
pub td: TempDir,
@@ -27,7 +27,7 @@ impl Test {
2727
if gcc.ends_with("deps") {
2828
gcc.pop();
2929
}
30-
let td = TempDir::new_in(&gcc, "gcc-test").unwrap();
30+
let td = Builder::new().prefix("gcc-test").tempdir_in(&gcc).unwrap();
3131
gcc.push(format!("gcc-shim{}", env::consts::EXE_SUFFIX));
3232
Test {
3333
td: td,

0 commit comments

Comments
 (0)