From 8219f3585a656ecbf97c6588084fa566ef4c0644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kj=C3=A4ll?= Date: Sun, 15 May 2022 17:10:40 +0200 Subject: [PATCH] replace tempdir with tempfile, as tempdir is deprecated --- Cargo.toml | 2 +- tests/template.rs | 4 ++-- tests/test.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4586cea..bc6c5b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ serde = "1.0.0" [dev-dependencies] serde_derive = "1.0.0" serde_json = "1.0.0" -tempdir = "0.3.4" +tempfile = "3.3.0" [[test]] name = "test" diff --git a/tests/template.rs b/tests/template.rs index f6053a9..840b4c0 100644 --- a/tests/template.rs +++ b/tests/template.rs @@ -1,5 +1,5 @@ use std::cell::RefCell; -use tempdir::TempDir; +use tempfile::TempDir; use std::fmt::Debug; use std::fs::File; use std::io::Write; @@ -492,7 +492,7 @@ fn run_test(test: serde_json::Map, data: Data) { // Make a temporary dir where we'll store our partials. This is to // avoid a race on filenames. - let tmpdir = TempDir::new("").expect("Failed to make tempdir"); + let tmpdir = TempDir::new().expect("Failed to make tempdir"); if let Some(value) = test.get("partials") { write_partials(tmpdir.path(), value) diff --git a/tests/test.rs b/tests/test.rs index a1c5017..bdfd0e0 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,7 +1,7 @@ extern crate mustache; extern crate serde; extern crate serde_json; -extern crate tempdir; +extern crate tempfile; #[macro_use] extern crate serde_derive;