aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs10
1 files changed, 5 insertions, 5 deletions
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 @@
1//! # Configuration 1//! # Configuration
2//! 2//!
3//! This module holds the data structures for network configuration. 3//! This module holds the data structures for network configuration.
4use serde::{Deserialize, Serialize};
5use log::{error, info}; 4use log::{error, info};
5use serde::{Deserialize, Serialize};
6 6
7/// Configuration for a single network 7/// Configuration for a single network
8#[derive(Debug, Serialize, Deserialize, Clone, Default)] 8#[derive(Debug, Serialize, Deserialize, Clone, Default)]
@@ -29,7 +29,7 @@ pub struct Config {
29 29
30 /// Valid blocks should have this many transactions 30 /// Valid blocks should have this many transactions
31 pub block_transaction_count: u8, 31 pub block_transaction_count: u8,
32 32
33 /// How many zero hexadecimal characters should a correct hash start with? 33 /// How many zero hexadecimal characters should a correct hash start with?
34 pub hash_zeros: u8, 34 pub hash_zeros: u8,
35 35
@@ -58,15 +58,15 @@ impl Config {
58 error!("Cannot read config file: {}", filename); 58 error!("Cannot read config file: {}", filename);
59 error!("Error: {:?}", e); 59 error!("Error: {:?}", e);
60 return None; 60 return None;
61 }, 61 }
62 }; 62 };
63 let config : Config = match serde_yaml::from_reader(file) { 63 let config: Config = match serde_yaml::from_reader(file) {
64 Ok(c) => c, 64 Ok(c) => c,
65 Err(e) => { 65 Err(e) => {
66 error!("Cannot parse config file: {}", filename); 66 error!("Cannot parse config file: {}", filename);
67 error!("Error: {:?}", e); 67 error!("Error: {:?}", e);
68 return None; 68 return None;
69 }, 69 }
70 }; 70 };
71 // File closes automatically when it goes out of scope. 71 // File closes automatically when it goes out of scope.
72 info!("Config file read successfully: {}", filename); 72 info!("Config file read successfully: {}", filename);