From 1b227bbd097cd03616467f14793dc6b2a147221b Mon Sep 17 00:00:00 2001 From: naglis <827324+naglis@users.noreply.github.com> Date: Thu, 7 Dec 2023 01:35:36 +0200 Subject: [PATCH] Use `tempfile` crate instead of `tempdir` `tempdir` was merged into `tempfile` and is now deprecated[1]. [1]: https://github.com/rust-lang-deprecated/tempdir#deprecation-note --- Cargo.toml | 2 +- tests/helpers/daemon.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9ab8585f..9073ad94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1", optional = true } [dev-dependencies] -tempdir = "0.3.5" +tempfile = "3.8.1" unix_socket = "0.5.0" [features] diff --git a/tests/helpers/daemon.rs b/tests/helpers/daemon.rs index a98a68c4..41d11e20 100644 --- a/tests/helpers/daemon.rs +++ b/tests/helpers/daemon.rs @@ -1,6 +1,6 @@ -extern crate tempdir; +extern crate tempfile; -use self::tempdir::TempDir; +use self::tempfile::TempDir; use super::mpd; use std::fs::{create_dir, File}; use std::io::{Read, Write}; @@ -92,7 +92,7 @@ static EMPTY_FLAC_BYTES: &[u8] = include_bytes!("../data/empty.flac"); impl Daemon { pub fn start() -> Daemon { - let temp_dir = TempDir::new("mpd-test").unwrap(); + let temp_dir = TempDir::with_prefix("mpd-test").unwrap(); let config = MpdConfig::new(&temp_dir); config.generate();