Replace deprecated tempdir dependency with tempfile (#11588)

`Tempdir` is deprecated, but the functionality has been merged into
another crate: `tempfile`. This commit removes all `tempdir` dependencies
and replaces them with `tempfile` and the equivalent bindings.

Fixes #11560
This commit is contained in:
marktoda
2020-03-29 13:31:17 -07:00
committed by GitHub
parent 4f26ffd447
commit 2a3217d8d8
76 changed files with 220 additions and 214 deletions

View File

@@ -1270,9 +1270,9 @@ fn load_key(path: &Path) -> Option<Secret> {
#[test]
fn key_save_load() {
use tempdir::TempDir;
use tempfile::TempDir;
let tempdir = TempDir::new("").unwrap();
let tempdir = TempDir::new().unwrap();
let key = H256::random().into();
save_key(tempdir.path(), &key);
let r = load_key(tempdir.path());

View File

@@ -616,7 +616,7 @@ mod tests {
use ethereum_types::H512;
use ipnetwork::IpNetwork;
use tempdir::TempDir;
use tempfile::TempDir;
use assert_matches::assert_matches;
@@ -782,7 +782,7 @@ mod tests {
#[test]
fn table_save_load() {
let tempdir = TempDir::new("").unwrap();
let tempdir = TempDir::new().unwrap();
let node1 = Node::from_str("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770").unwrap();
let node2 = Node::from_str("enode://b979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770").unwrap();
let node3 = Node::from_str("enode://c979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770").unwrap();