Skip to content

Commit b5c392c

Browse files
authored
replace use of tempdir with tempfile (#1002)
1 parent ca0d879 commit b5c392c

4 files changed

Lines changed: 11 additions & 73 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ semver = "1.0.28"
3939
serde = "1.0.228"
4040
serde_json = "1.0.149"
4141
syn = { version = "2.0.117", features = ["full"] }
42-
tempdir = "0.3.7"
42+
tempfile = "3.8.1"
4343
thiserror = "2.0.18"
4444
trybuild = "1.0.116"
4545
unicode-ident = "1.0.24"

cargo-typify/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ schemars = { workspace = true }
2626
assert_cmd = { workspace = true }
2727
expectorate = { workspace = true }
2828
newline-converter = { workspace = true }
29-
tempdir = { workspace = true }
29+
tempfile = { workspace = true }

cargo-typify/tests/integration.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use expectorate::assert_contents;
22
use newline_converter::dos2unix;
3-
use tempdir::TempDir;
3+
use tempfile::TempDir;
44

55
#[test]
66
fn test_simple() {
77
let input = concat!(env!("CARGO_MANIFEST_DIR"), "/../example.json");
88

9-
let temp = TempDir::new("cargo-typify").unwrap();
9+
let temp = TempDir::new().unwrap();
1010
let input_file = temp.path().join("simple.json");
1111
std::fs::copy(input, &input_file).unwrap();
1212

@@ -26,7 +26,7 @@ fn test_simple() {
2626
fn test_default_output() {
2727
let input = concat!(env!("CARGO_MANIFEST_DIR"), "/../example.json");
2828

29-
let temp = TempDir::new("cargo-typify").unwrap();
29+
let temp = TempDir::new().unwrap();
3030
let output_file = temp.path().join("output.rs");
3131

3232
assert_cmd::cargo::cargo_bin_cmd!()
@@ -59,7 +59,7 @@ fn test_no_builder_stdout() {
5959
fn test_builder() {
6060
let input = concat!(env!("CARGO_MANIFEST_DIR"), "/../example.json");
6161

62-
let temp = TempDir::new("cargo-typify").unwrap();
62+
let temp = TempDir::new().unwrap();
6363
let output_file = temp.path().join("output.rs");
6464

6565
assert_cmd::cargo::cargo_bin_cmd!()
@@ -82,7 +82,7 @@ fn test_builder() {
8282
fn test_derive() {
8383
let input = concat!(env!("CARGO_MANIFEST_DIR"), "/../example.json");
8484

85-
let temp = TempDir::new("cargo-typify").unwrap();
85+
let temp = TempDir::new().unwrap();
8686
let output_file = temp.path().join("output.rs");
8787

8888
assert_cmd::cargo::cargo_bin_cmd!()
@@ -107,7 +107,7 @@ fn test_derive() {
107107
fn test_attr() {
108108
let input = concat!(env!("CARGO_MANIFEST_DIR"), "/../example.json");
109109

110-
let temp = TempDir::new("cargo-typify").unwrap();
110+
let temp = TempDir::new().unwrap();
111111
let output_file = temp.path().join("output.rs");
112112

113113
assert_cmd::cargo::cargo_bin_cmd!()
@@ -132,7 +132,7 @@ fn test_attr() {
132132
fn test_multi_derive() {
133133
let input = concat!(env!("CARGO_MANIFEST_DIR"), "/../example.json");
134134

135-
let temp = TempDir::new("cargo-typify").unwrap();
135+
let temp = TempDir::new().unwrap();
136136
let output_file = temp.path().join("output.rs");
137137

138138
assert_cmd::cargo::cargo_bin_cmd!()
@@ -173,7 +173,7 @@ fn test_help() {
173173
fn test_btree_map() {
174174
let input = concat!(env!("CARGO_MANIFEST_DIR"), "/../example.json");
175175

176-
let temp = TempDir::new("cargo-typify").unwrap();
176+
let temp = TempDir::new().unwrap();
177177
let output_file = temp.path().join("output.rs");
178178

179179
assert_cmd::cargo::cargo_bin_cmd!()

0 commit comments

Comments
 (0)