Replace tempdir crate with tempfile

This commit is contained in:
Julian Braha 2024-01-24 17:58:09 +00:00
parent f8604e88ef
commit fd6f71d287
15 changed files with 78 additions and 119 deletions

View file

@ -11,7 +11,7 @@ path = "src/util.rs"
doctest = true
[features]
test-support = ["tempdir", "git2"]
test-support = ["tempfile", "git2"]
[dependencies]
anyhow.workspace = true
@ -25,7 +25,7 @@ smol.workspace = true
url = "2.2"
rand.workspace = true
rust-embed.workspace = true
tempdir = { workspace = true, optional = true }
tempfile = { workspace = true, optional = true }
serde.workspace = true
serde_json.workspace = true
git2 = { workspace = true, optional = true }
@ -33,5 +33,5 @@ dirs = "3.0"
take-until = "0.2.0"
[dev-dependencies]
tempdir.workspace = true
tempfile.workspace = true
git2.workspace = true

View file

@ -6,13 +6,13 @@ use std::{
ffi::OsStr,
path::{Path, PathBuf},
};
use tempdir::TempDir;
use tempfile::TempDir;
pub use assertions::*;
pub use marked_text::*;
pub fn temp_tree(tree: serde_json::Value) -> TempDir {
let dir = TempDir::new("").unwrap();
let dir = TempDir::new().unwrap();
write_tree(dir.path(), tree);
dir
}