diff --git a/crates/main/main.rs b/crates/main/main.rs index 517f884..4b63cfe 100644 --- a/crates/main/main.rs +++ b/crates/main/main.rs @@ -7,6 +7,7 @@ Main program for `pacdef`. All internal logic happens in [`pacdef_core`]. clippy::option_if_let_else, clippy::redundant_pub_crate, clippy::semicolon_if_nothing_returned, + clippy::unnecessary_wraps, clippy::unused_self, clippy::unwrap_used, clippy::use_debug, diff --git a/crates/pacdef_core/src/lib.rs b/crates/pacdef_core/src/lib.rs index d0a8216..d910590 100644 --- a/crates/pacdef_core/src/lib.rs +++ b/crates/pacdef_core/src/lib.rs @@ -13,6 +13,7 @@ This library contains all logic that happens in `pacdef` under the hood. clippy::option_if_let_else, clippy::redundant_pub_crate, clippy::semicolon_if_nothing_returned, + clippy::unnecessary_wraps, clippy::unused_self, clippy::unwrap_used, clippy::use_debug, diff --git a/crates/pacdef_core/src/path.rs b/crates/pacdef_core/src/path.rs index e5805ad..0c69299 100644 --- a/crates/pacdef_core/src/path.rs +++ b/crates/pacdef_core/src/path.rs @@ -123,15 +123,18 @@ where /// For each file argument, return the absolute path to the file. pub(crate) fn get_absolutized_file_paths(arg_match: &[String]) -> Result> { - Ok(arg_match - .iter() - .map(PathBuf::from) - .map(|path| { - path.absolutize() - .expect("absolute path should exist") - .into_owned() - }) - .collect()) + let mut result = vec![]; + + for item in arg_match { + let path: PathBuf = item.into(); + let absolute = path + .absolutize() + .with_context(|| format!("absolutizing {path:?}"))? + .into_owned(); + result.push(absolute); + } + + Ok(result) } #[cfg(test)] diff --git a/crates/pacdef_macros/src/lib.rs b/crates/pacdef_macros/src/lib.rs index 70466be..134f540 100644 --- a/crates/pacdef_macros/src/lib.rs +++ b/crates/pacdef_macros/src/lib.rs @@ -13,6 +13,7 @@ Procedural macros for `pacdef`. clippy::option_if_let_else, clippy::redundant_pub_crate, clippy::semicolon_if_nothing_returned, + clippy::unnecessary_wraps, clippy::unused_self, clippy::unwrap_used, clippy::use_debug,