Use PathBuf instead of String for CliArgs::config_file
This commit is contained in:
parent
c0d20759a1
commit
5d64a8ed1f
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@ use clap::Parser;
|
|||
use log::{debug, error, warn};
|
||||
use reqwest::blocking::Client;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::process::Command;
|
||||
use std::{process::Command, path::PathBuf};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let args = CliArgs::parse();
|
||||
|
@ -19,7 +19,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
);
|
||||
}
|
||||
|
||||
debug!("Opening Config file: {}", args.config_file);
|
||||
debug!("Opening Config file: {}", args.config_file.display());
|
||||
debug!(
|
||||
"Config file exists: {}",
|
||||
std::fs::metadata(&args.config_file).is_ok()
|
||||
|
@ -140,7 +140,7 @@ struct Config {
|
|||
struct CliArgs {
|
||||
/// Path to config .toml file
|
||||
#[arg(short, long)]
|
||||
config_file: String,
|
||||
config_file: PathBuf,
|
||||
|
||||
#[arg(short, long)]
|
||||
hddtemp_executable: String,
|
||||
|
|
Loading…
Reference in a new issue