From 19db08d88036b09486203c01ad04420c781717ab Mon Sep 17 00:00:00 2001 From: gifnksm Date: Wed, 24 Aug 2022 12:17:01 +0900 Subject: [PATCH] Use tempfile crate instead of tempdir tempdir is deprecated fixes #23 --- xtask/Cargo.toml | 2 +- xtask/src/lint_doc.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index b26ed66..d921ded 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -8,4 +8,4 @@ edition = "2021" [dependencies] cli-xtask = { path = "../", default-features = false, features = ["main", "lib-crate-extra", "subcommand-exec"] } dir-diff = "0.3.2" -tempdir = "0.3.7" +tempfile = "3.3.0" diff --git a/xtask/src/lint_doc.rs b/xtask/src/lint_doc.rs index 78e65a2..b226711 100644 --- a/xtask/src/lint_doc.rs +++ b/xtask/src/lint_doc.rs @@ -1,4 +1,4 @@ -use tempdir::TempDir; +use tempfile::TempDir; use cli_xtask::{ camino::Utf8Path, clap, config::Config, eyre::eyre, tracing, workspace, Error, Result, @@ -18,7 +18,7 @@ impl LintDoc { let workspace = workspace::current(); let doc_dir = workspace.workspace_root.join("doc"); - let reference_dir = TempDir::new("reference")?; + let reference_dir = TempDir::new()?; super::tidy_doc::emit_doc(workspace, <&Utf8Path>::try_from(reference_dir.path())?)?; if dir_diff::is_different(&doc_dir, &reference_dir).map_err(|e| -> Error {