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

@@ -42,7 +42,7 @@ spec = { path = "../spec" }
# Benches
ethash = { package = "ethash-engine", path = "../engines/ethash" }
tempdir = "0.3.7"
tempfile = "3.1"
[features]
# Used to selectively expose code for benchmarks.

View File

@@ -24,7 +24,7 @@ use ethash::{EthashParams, Ethash};
use ethereum_types::U256;
use ethcore::test_helpers::TestBlockChainClient;
use spec::new_constantinople_test_machine;
use tempdir::TempDir;
use tempfile::TempDir;
use ::verification::{
FullFamilyParams,
@@ -72,7 +72,7 @@ fn ethash_params() -> EthashParams {
fn build_ethash() -> Ethash {
let machine = new_constantinople_test_machine();
let ethash_params = ethash_params();
let cache_dir = TempDir::new("").unwrap();
let cache_dir = TempDir::new().unwrap();
Ethash::new(
cache_dir.path(),
ethash_params,