Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI:fixes the linting error #140

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions florestad/src/config_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,14 @@ pub struct Wallet {
pub addresses: Option<Vec<String>>,
}

#[derive(Default, Debug, Deserialize)]
pub struct Rpc {
pub rpc_user: Option<String>,
pub rpc_password: Option<String>,
pub rpc_host: Option<String>,
pub rpc_port: Option<u32>,
}
#[derive(Default, Debug, Deserialize)]
pub struct Misc {
pub batch_sync: Option<String>,
}
#[derive(Default, Debug, Deserialize)]
pub struct ConfigFile {
pub rpc: Option<Rpc>,
pub wallet: Wallet,
pub misc: Option<Misc>,
}

impl ConfigFile {
pub fn from_file(filename: &str) -> Result<Self, crate::error::Error> {
let file = std::fs::read_to_string(filename)?;
Ok(toml::from_str(file.as_str())?)
Ok(toml::from_str(&file)?)
}
}
Loading