From 7d308f86b2c301dfd3bafbcc2a51f4522918e6ae Mon Sep 17 00:00:00 2001 From: OsauravO Date: Tue, 9 Apr 2024 02:02:07 +0530 Subject: [PATCH] CI:fixes the linting error --- florestad/src/config_file.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/florestad/src/config_file.rs b/florestad/src/config_file.rs index 2f25dbad..38e02a4e 100644 --- a/florestad/src/config_file.rs +++ b/florestad/src/config_file.rs @@ -7,26 +7,14 @@ pub struct Wallet { pub addresses: Option>, } -#[derive(Default, Debug, Deserialize)] -pub struct Rpc { - pub rpc_user: Option, - pub rpc_password: Option, - pub rpc_host: Option, - pub rpc_port: Option, -} -#[derive(Default, Debug, Deserialize)] -pub struct Misc { - pub batch_sync: Option, -} #[derive(Default, Debug, Deserialize)] pub struct ConfigFile { - pub rpc: Option, pub wallet: Wallet, - pub misc: Option, } + impl ConfigFile { pub fn from_file(filename: &str) -> Result { let file = std::fs::read_to_string(filename)?; - Ok(toml::from_str(file.as_str())?) + Ok(toml::from_str(&file)?) } }