replace tempdir by tempfile (#2143)

## Issue Addressed

Fixes #2141 
Remove [tempdir](https://docs.rs/tempdir/0.3.7/tempdir/) in favor of [tempfile](https://docs.rs/tempfile/3.1.0/tempfile/).

## Proposed Changes

`tempfile` has a slightly different api that makes creating temp folders with a name prefix a chore (`tempdir::TempDir::new("toto")` => `tempfile::Builder::new().prefix("toto").tempdir()`).

So I removed temp folder name prefix where I deemed it not useful.

Otherwise, the functionality is the same.
This commit is contained in:
Arthur Woimbée
2021-01-06 06:36:11 +00:00
parent 7e4b190df0
commit 851a4dca3c
21 changed files with 64 additions and 74 deletions

View File

@@ -10,7 +10,6 @@ path = "src/lib.rs"
[dev-dependencies]
tokio = { version = "0.3.2", features = ["time", "rt-multi-thread", "macros"] }
tempfile = "3.1.0"
deposit_contract = { path = "../common/deposit_contract" }
tokio-compat-02 = "0.1"
@@ -46,7 +45,7 @@ hex = "0.4.2"
deposit_contract = { path = "../common/deposit_contract" }
bls = { path = "../crypto/bls" }
eth2 = { path = "../common/eth2" }
tempdir = "0.3.7"
tempfile = "3.1.0"
rayon = "1.4.1"
validator_dir = { path = "../common/validator_dir" }
clap_utils = { path = "../common/clap_utils" }

View File

@@ -8,7 +8,7 @@ use slog::{crit, error, warn, Logger};
use slot_clock::SlotClock;
use std::path::Path;
use std::sync::Arc;
use tempdir::TempDir;
use tempfile::TempDir;
use types::{
Attestation, BeaconBlock, ChainSpec, Domain, Epoch, EthSpec, Fork, Hash256, Keypair, PublicKey,
SelectionProof, Signature, SignedAggregateAndProof, SignedBeaconBlock, SignedRoot, Slot,