From 21095d29f348d8c965df9871bbc0644de5000a53 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sat, 23 Apr 2022 20:29:36 +0300 Subject: Format, refactor, succinct errors --- src/config.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 28c63be..112fb3c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,8 +1,8 @@ //! # Configuration //! //! This module holds the data structures for network configuration. -use serde::{Deserialize, Serialize}; use log::{error, info}; +use serde::{Deserialize, Serialize}; /// Configuration for a single network #[derive(Debug, Serialize, Deserialize, Clone, Default)] @@ -29,7 +29,7 @@ pub struct Config { /// Valid blocks should have this many transactions pub block_transaction_count: u8, - + /// How many zero hexadecimal characters should a correct hash start with? pub hash_zeros: u8, @@ -58,15 +58,15 @@ impl Config { error!("Cannot read config file: {}", filename); error!("Error: {:?}", e); return None; - }, + } }; - let config : Config = match serde_yaml::from_reader(file) { + let config: Config = match serde_yaml::from_reader(file) { Ok(c) => c, Err(e) => { error!("Cannot parse config file: {}", filename); error!("Error: {:?}", e); return None; - }, + } }; // File closes automatically when it goes out of scope. info!("Config file read successfully: {}", filename); -- cgit v1.2.3-70-g09d2