Skip to content

Commit 9d6e451

Browse files
committed
Upgrade from deprecated tempdir crate
1 parent b01b1d7 commit 9d6e451

File tree

3 files changed

+9
-59
lines changed

3 files changed

+9
-59
lines changed

ui/Cargo.lock

Lines changed: 3 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ serde_derive = "1.0"
2727
serde_json = "1.0"
2828
snafu = "0.7.0"
2929
strum = { version = "0.24.0", features = ["derive"] }
30-
tempdir = "0.3.7"
30+
tempfile = "3"
3131
tokio = { version = "1.9", features = ["macros", "time", "process", "rt-multi-thread"] }
3232
tower-http = { version = "0.3", features = ["cors", "fs", "set-header", "trace"] }

ui/src/sandbox.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub mod fut {
224224
io::ErrorKind,
225225
path::{Path, PathBuf},
226226
};
227-
use tempdir::TempDir;
227+
use tempfile::TempDir;
228228
use tokio::{fs, process::Command, time};
229229

230230
use super::{
@@ -257,7 +257,10 @@ pub mod fut {
257257
// now and when it's dropped. We accept that under the
258258
// assumption that the specific operations will be quick
259259
// enough.
260-
let scratch = TempDir::new("playground").context(UnableToCreateTempDirSnafu)?;
260+
let scratch = tempfile::Builder::new()
261+
.prefix("playground")
262+
.tempdir()
263+
.context(UnableToCreateTempDirSnafu)?;
261264
let input_file = scratch.path().join("input.rs");
262265
let output_dir = scratch.path().join("output");
263266

0 commit comments

Comments
 (0)