Validating sha3 of a dapp bundle (#1993)

* Validating sha3 of a file

* sha3 in utils

* Removing devtools
This commit is contained in:
Tomasz Drwięga
2016-08-24 16:53:07 +02:00
committed by Gav Wood
parent 3dd1bdda50
commit 33e0a234f2
7 changed files with 84 additions and 16 deletions

View File

@@ -67,10 +67,18 @@ impl RandomTempPath {
}
}
impl AsRef<Path> for RandomTempPath {
fn as_ref(&self) -> &Path {
self.as_path()
}
}
impl Drop for RandomTempPath {
fn drop(&mut self) {
if let Err(e) = fs::remove_dir_all(self.as_path()) {
panic!("Failed to remove temp directory. Here's what prevented this from happening: ({})", e);
if let Err(_) = fs::remove_dir_all(&self) {
if let Err(e) = fs::remove_file(&self) {
panic!("Failed to remove temp directory. Here's what prevented this from happening: ({})", e);
}
}
}
}