Fix clippy's performance lints (#1286)

* Fix clippy perf lints

* Cargo fmt

* Add  and  to lint rule in Makefile

* Fix some leftover clippy lints
This commit is contained in:
pscott
2020-06-25 16:04:08 +02:00
committed by GitHub
parent b3c01bf09d
commit 02174e21d8
26 changed files with 82 additions and 84 deletions

View File

@@ -10,12 +10,13 @@ const TESTNET_ID: &str = "witti-v0-11-3";
fn main() {
if !base_dir().exists() {
std::fs::create_dir_all(base_dir()).expect(&format!("Unable to create {:?}", base_dir()));
std::fs::create_dir_all(base_dir())
.unwrap_or_else(|_| panic!("Unable to create {:?}", base_dir()));
match get_all_files() {
Ok(()) => (),
Err(e) => {
std::fs::remove_dir_all(base_dir()).expect(&format!(
std::fs::remove_dir_all(base_dir()).unwrap_or_else(|_| panic!(
"{}. Failed to remove {:?}, please remove the directory manually because it may contains incomplete testnet data.",
e,
base_dir(),