diff --git a/src/main.rs b/src/main.rs index fa0e462..761b71e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,7 @@ use globset::GlobBuilder; use lscolors::LsColors; use regex::bytes::{RegexBuilder, RegexSetBuilder}; +use crate::error::print_error; use crate::exec::CommandTemplate; use crate::exit_codes::ExitCode; use crate::filetypes::FileTypes; @@ -90,7 +91,13 @@ fn run() -> Result { )) } }) - .collect::>>()?, + .inspect(|res| { + if let Err(e) = res { + print_error(format!("{}", e)) + } + }) + .filter_map(Result::ok) + .collect::>(), None => vec![current_directory.to_path_buf()], };