From b0d5243fb45d14fc7cc687ed976a97efb88d8e6c Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Mon, 31 Jan 2022 10:54:42 +0100 Subject: [PATCH] Remove unmaintained dependency Replace `tempdir` development dependency with `tempfile`. Fixes https://github.com/sigstore/sigstore-rs/issues/23 Signed-off-by: Flavio Castelli --- Cargo.toml | 2 +- src/tuf/repository_helper.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4fc467f85e..c19cd23013 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,5 +34,5 @@ anyhow = "1.0.44" chrono = "0.4.19" clap = "2.33.3" openssl = "0.10.38" -tempdir = "0.3.7" +tempfile = "3.3.0" tracing-subscriber = "0.2.25" diff --git a/src/tuf/repository_helper.rs b/src/tuf/repository_helper.rs index 9aee0b9e42..79251ca4cf 100644 --- a/src/tuf/repository_helper.rs +++ b/src/tuf/repository_helper.rs @@ -187,7 +187,7 @@ mod tests { use super::super::constants::*; use super::*; use std::path::PathBuf; - use tempdir::TempDir; + use tempfile::TempDir; /// Returns the path to our test data directory fn test_data() -> PathBuf { @@ -274,8 +274,7 @@ mod tests { #[test] fn download_files_to_local_cache() { - let cache_dir = - TempDir::new("sigstore-test-tuf-cache").expect("Cannot create temp cache dir"); + let cache_dir = TempDir::new().expect("Cannot create temp cache dir"); let repository = local_tuf_repo().expect("Local TUF repo should not fail"); let helper = RepositoryHelper { @@ -304,8 +303,7 @@ mod tests { #[test] fn update_local_cache() { - let cache_dir = - TempDir::new("sigstore-test-tuf-cache").expect("Cannot create temp cache dir"); + let cache_dir = TempDir::new().expect("Cannot create temp cache dir"); // put some outdated files inside of the cache fs::write(