diff options
author | ClementTsang <34804052+ClementTsang@users.noreply.github.com> | 2024-05-18 00:54:49 -0400 |
---|---|---|
committer | ClementTsang <34804052+ClementTsang@users.noreply.github.com> | 2024-05-18 00:54:49 -0400 |
commit | 7bfb07c046e476afb77929257037871af60dcb2b (patch) | |
tree | b83e9073185ff91467238a32ab5ff28f9eb2b3d9 /src/lib.rs | |
parent | 90c6ee07d83a8a02866c34e54fd7cba002c1195b (diff) |
tmpargs_struct
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -35,7 +35,7 @@ use std::{ fs, io::{stderr, stdout, Write}, panic::PanicInfo, - path::PathBuf, + path::{Path, PathBuf}, sync::{ mpsc::{Receiver, Sender}, Arc, Condvar, Mutex, @@ -202,9 +202,9 @@ pub fn handle_key_event_or_break( false } -pub fn read_config(config_location: Option<&String>) -> error::Result<Option<PathBuf>> { +pub fn read_config(config_location: Option<&Path>) -> error::Result<Option<PathBuf>> { let config_path = if let Some(conf_loc) = config_location { - Some(PathBuf::from(conf_loc.as_str())) + Some(conf_loc.to_path_buf()) } else if cfg!(target_os = "windows") { if let Some(home_path) = dirs::config_dir() { let mut path = home_path; |