From 3f72e9b81ac1a1dcbe900163957ad28cffcffd81 Mon Sep 17 00:00:00 2001
From: Jiahao XU <Jiahao_XU@outlook.com>
Date: Thu, 28 Jul 2022 01:45:54 +1000
Subject: [PATCH] Use `tempfile::NamedTempFile` in unit test of `binstall_v1`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---
 src/metafiles/binstall_v1.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs
index 2ed1d6c7..d20ed712 100644
--- a/src/metafiles/binstall_v1.rs
+++ b/src/metafiles/binstall_v1.rs
@@ -230,7 +230,7 @@ mod test {
     use super::*;
     use crate::target::TARGET;
 
-    use tempfile::TempDir;
+    use tempfile::NamedTempFile;
 
     macro_rules! assert_records_eq {
         ($records:expr, $metadata_set:expr) => {
@@ -245,8 +245,8 @@ mod test {
     fn rw_test() {
         let target = CompactString::from(TARGET);
 
-        let tempdir = TempDir::new().unwrap();
-        let path = tempdir.path().join("binstall-tests.json");
+        let named_tempfile = NamedTempFile::new().unwrap();
+        let path = named_tempfile.path();
 
         let metadata_vec = [
             MetaData {