Skip to content

Commit

Permalink
Merge pull request #156 from LingMan/tmpdir
Browse files Browse the repository at this point in the history
Replace deprecated dependency `tempdir` with its successor `tempfile`
  • Loading branch information
oli-obk authored Jun 20, 2022
2 parents b31fcd7 + ef22ceb commit 83ca177
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 59 deletions.
59 changes: 3 additions & 56 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ serde_json = "1.0"
clap = { version = "3.1", features = ["derive"] }
tar = "0.4"
tee = "0.1"
tempdir = "0.3.7"
tempfile = "3"
xz2 = "0.1.6"
chrono = "0.4.11"
colored = "2"
Expand Down
5 changes: 3 additions & 2 deletions src/toolchains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use reqwest::header::CONTENT_LENGTH;
use rustc_version::Channel;
use tar::Archive;
use tee::TeeReader;
use tempdir::TempDir;
use xz2::read::XzDecoder;

use crate::Config;
Expand Down Expand Up @@ -109,7 +108,9 @@ impl Toolchain {
) -> Result<(), InstallError> {
let tc_stdstream_str = format!("{self}");
eprintln!("installing {}", tc_stdstream_str.green());
let tmpdir = TempDir::new_in(&dl_params.tmp_dir, &self.rustup_name())
let tmpdir = tempfile::Builder::new()
.prefix(&self.rustup_name())
.tempdir_in(&dl_params.tmp_dir)
.map_err(InstallError::TempDir)?;
let dest = dl_params.install_dir.join(self.rustup_name());
if dl_params.force_install {
Expand Down

0 comments on commit 83ca177

Please sign in to comment.