From 23e0e013ab0f6422fa57e954f7fb6340a38b679f Mon Sep 17 00:00:00 2001 From: Jared Moulton Date: Sat, 17 Aug 2024 22:58:14 -0600 Subject: [PATCH] fix error (#119) --- src/configs.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/configs.rs b/src/configs.rs index 6d5b286..7c76f2d 100644 --- a/src/configs.rs +++ b/src/configs.rs @@ -139,20 +139,18 @@ impl Config { .iter() .map(|search_dir| { let expanded_path = shellexpand::full(&search_dir.path.to_string_lossy()) - .change_context(ConfigError::IoError) - .unwrap() + .change_context(ConfigError::IoError)? .to_string(); let path = canonicalize(expanded_path) - .change_context(ConfigError::IoError) - .unwrap(); + .change_context(ConfigError::IoError)?; - SearchDirectory::new(path, search_dir.depth) + Ok(SearchDirectory::new(path, search_dir.depth)) }) - .collect() + .collect::>() } else { - Vec::new() - }; + Ok(Vec::new()) + }?; // merge old search paths with new search directories if let Some(search_paths) = self.search_paths.as_ref() {