Skip to content

Commit

Permalink
Replace tempdir with tempfile
Browse files Browse the repository at this point in the history
Summary:
`tempdir` has been deprecated since 2018:
rust-lang-deprecated/tempdir#46

It's functionality was merged into `tempfile` with minor tweaks:

- Methods names: `new` -> `with_prefix`, `new_in` -> `with_prefix_in`.
- `with_prefix_in`'s args order is reversed.
- Temp dirs no longer have a period between the prefix and the random
  name (before `foo.123abc`, now `foo123abc`).

Reviewed By: shayne-fletcher

Differential Revision: D50526255

fbshipit-source-id: bdb3b53a6b09a09c70c8e2533ad2cea46ee2842b
  • Loading branch information
zertosh authored and facebook-github-bot committed Oct 21, 2023
1 parent 663380e commit baf9d9a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 58 deletions.
104 changes: 48 additions & 56 deletions packer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ xz2 = "0.1.7"
ignore = "0.4.20"

[dev-dependencies]
tempdir = "0.3.7"
tempfile = "3.8.0"
2 changes: 1 addition & 1 deletion packer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ mod test {
.join("src")
.join("__fixtures__")
.join("archive_a.tar");
let tmp_dir = tempdir::TempDir::new("manifest_test")?;
let tmp_dir = tempfile::TempDir::with_prefix("manifest_test.")?;

let archive_paths = &[(&PackType::new("core"), artifact_path)];
let path = manifest(archive_paths, &None, tmp_dir.path())?;
Expand Down

0 comments on commit baf9d9a

Please sign in to comment.