use tempfile to replace tempdir

Signed-off-by: ekexium <ekexium@gmail.com>
This commit is contained in:
ekexium 2021-01-06 15:46:23 +08:00
parent 684059a341
commit c1bb955832
4 changed files with 3 additions and 7 deletions

View File

@ -45,7 +45,6 @@ clap = "2.32"
fail = { version = "0.3", features = [ "failpoints" ] }
proptest = "0.9"
proptest-derive = "0.1.0"
tempdir = "0.3"
serial_test = "0.5.0"
simple_logger = "1.9.0"
tokio = { version = "1.0", features = [ "sync", "rt-multi-thread", "macros" ] }

View File

@ -18,5 +18,5 @@ clap = "2.32"
fail = { version = "0.3", features = [ "failpoints" ] }
proptest = "0.9"
proptest-derive = "0.1.0"
tempdir = "0.3"
tempfile = "3"
tokio = "1.0"

View File

@ -96,16 +96,14 @@ impl SecurityManager {
#[cfg(test)]
mod tests {
extern crate tempdir;
use super::*;
use std::{fs::File, io::Write, path::PathBuf};
use self::tempdir::TempDir;
use tempfile;
#[test]
fn test_security() {
let temp = TempDir::new("test_cred").unwrap();
let temp = tempfile::tempdir().unwrap();
let example_ca = temp.path().join("ca");
let example_cert = temp.path().join("cert");
let example_pem = temp.path().join("key");

View File

@ -16,4 +16,3 @@ clap = "2.32"
fail = { version = "0.3", features = [ "failpoints" ] }
proptest = "0.9"
proptest-derive = "0.1.0"
tempdir = "0.3"