switch to manual toml derserialization

This commit is contained in:
Nickiel12 2023-08-25 21:43:06 -07:00
parent 0f107a3985
commit 9cf719abe4
3 changed files with 75 additions and 92 deletions

View file

@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
chrono = "0.4.26"
clap = { version = "4.4.0", features = ["derive"] }
confy = "0.5.1"
reqwest = { version = "0.11.18", features = ["blocking", "json"] }
serde = { version = "1.0.184", features = ["serde_derive"] }
serde_json = "1.0.105"
toml = "0.7.6"

View file

@ -1,8 +1,8 @@
use serde::{Deserialize, Serialize};
use reqwest::blocking::Client;
use toml;
use clap::Parser;
use confy;
use std::process::Command;
@ -16,7 +16,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Opening Config file: {}", args.config_file);
println!("File exists: {}", std::fs::metadata(args.config_file.clone()).is_ok());
let cfg: Config = confy::load_path(args.config_file)?;
let cfg: Config = toml::from_str(std::fs::read_to_string(args.config_file)?.as_str())?;
let mut body_content: String = format!("*Last Updated:* {} \n", chrono::Local::now().format("%D - %H:%M:%S"));
let mut drives: Vec<String> = vec![];