From e1083962fd90a333d27e893a73b03d0dd1affd43 Mon Sep 17 00:00:00 2001 From: Simmer505 Date: Sun, 4 Feb 2024 18:58:20 -0600 Subject: [PATCH] Forgot a couple unwraps --- src/config/cfg.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/config/cfg.rs b/src/config/cfg.rs index 4d48866..afc3ecd 100644 --- a/src/config/cfg.rs +++ b/src/config/cfg.rs @@ -18,9 +18,9 @@ pub struct Config { impl Config { pub fn parse(path: PathBuf) -> Result { - let config_file = Config::read_config(path).unwrap(); + let config_file = Config::read_config(path)?; - let dotfiles = Config::get_dotfiles(&config_file).unwrap(); + let dotfiles = Config::get_dotfiles(&config_file)?; let manager_dir = Config::get_manager_dir(&config_file); @@ -58,7 +58,10 @@ impl Config { let dotfiles = dotfile_iter.map(|dotfile| { - let dotfile_table = dotfile.as_table().unwrap(); + let dotfile_table = match dotfile.as_table() { + Some(table) => table, + None => return Err(ConfigParseError::DotfilesParseError), + }; let manager_path = PathBuf::from( match dotfile_table.get("manager_path") {