Skip to content

Commit eaf78af

Browse files
committed
Auto merge of #2186 - JohnTitor:use-tempfile, r=locks
Replace `tempdir` with `tempfile` replaces `tempdir` which is deprecated with `tempfile`
2 parents c82d5db + b5f347d commit eaf78af

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

Cargo.lock

Lines changed: 1 addition & 11 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
@@ -58,7 +58,7 @@ docopt = "1.0"
5858
scheduled-thread-pool = "0.2.0"
5959
derive_deref = "1.0.0"
6060
reqwest = "0.9.1"
61-
tempdir = "0.3.7"
61+
tempfile = "3"
6262
parking_lot = "0.7.1"
6363
jemallocator = { version = "0.3", features = ['unprefixed_malloc_on_supported_platforms', 'profiling'] }
6464

src/git.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::collections::HashMap;
44
use std::fs::{self, OpenOptions};
55
use std::path::{Path, PathBuf};
66
use swirl::PerformError;
7-
use tempdir::TempDir;
7+
use tempfile::{Builder, TempDir};
88
use url::Url;
99

1010
use crate::background_jobs::Environment;
@@ -148,7 +148,7 @@ pub struct Repository {
148148

149149
impl Repository {
150150
pub fn open(repository_config: &RepositoryConfig) -> Result<Self, PerformError> {
151-
let checkout_path = TempDir::new("git")?;
151+
let checkout_path = Builder::new().prefix("git").tempdir()?;
152152

153153
let repository = git2::build::RepoBuilder::new()
154154
.fetch_options(Self::fetch_options(&repository_config.credentials))

0 commit comments

Comments
 (0)