refact: unncessary wraps
This commit is contained in:
@@ -7,6 +7,7 @@ Main program for `pacdef`. All internal logic happens in [`pacdef_core`].
|
|||||||
clippy::option_if_let_else,
|
clippy::option_if_let_else,
|
||||||
clippy::redundant_pub_crate,
|
clippy::redundant_pub_crate,
|
||||||
clippy::semicolon_if_nothing_returned,
|
clippy::semicolon_if_nothing_returned,
|
||||||
|
clippy::unnecessary_wraps,
|
||||||
clippy::unused_self,
|
clippy::unused_self,
|
||||||
clippy::unwrap_used,
|
clippy::unwrap_used,
|
||||||
clippy::use_debug,
|
clippy::use_debug,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ This library contains all logic that happens in `pacdef` under the hood.
|
|||||||
clippy::option_if_let_else,
|
clippy::option_if_let_else,
|
||||||
clippy::redundant_pub_crate,
|
clippy::redundant_pub_crate,
|
||||||
clippy::semicolon_if_nothing_returned,
|
clippy::semicolon_if_nothing_returned,
|
||||||
|
clippy::unnecessary_wraps,
|
||||||
clippy::unused_self,
|
clippy::unused_self,
|
||||||
clippy::unwrap_used,
|
clippy::unwrap_used,
|
||||||
clippy::use_debug,
|
clippy::use_debug,
|
||||||
|
|||||||
@@ -123,15 +123,18 @@ where
|
|||||||
|
|
||||||
/// For each file argument, return the absolute path to the file.
|
/// For each file argument, return the absolute path to the file.
|
||||||
pub(crate) fn get_absolutized_file_paths(arg_match: &[String]) -> Result<Vec<PathBuf>> {
|
pub(crate) fn get_absolutized_file_paths(arg_match: &[String]) -> Result<Vec<PathBuf>> {
|
||||||
Ok(arg_match
|
let mut result = vec![];
|
||||||
.iter()
|
|
||||||
.map(PathBuf::from)
|
for item in arg_match {
|
||||||
.map(|path| {
|
let path: PathBuf = item.into();
|
||||||
path.absolutize()
|
let absolute = path
|
||||||
.expect("absolute path should exist")
|
.absolutize()
|
||||||
.into_owned()
|
.with_context(|| format!("absolutizing {path:?}"))?
|
||||||
})
|
.into_owned();
|
||||||
.collect())
|
result.push(absolute);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Procedural macros for `pacdef`.
|
|||||||
clippy::option_if_let_else,
|
clippy::option_if_let_else,
|
||||||
clippy::redundant_pub_crate,
|
clippy::redundant_pub_crate,
|
||||||
clippy::semicolon_if_nothing_returned,
|
clippy::semicolon_if_nothing_returned,
|
||||||
|
clippy::unnecessary_wraps,
|
||||||
clippy::unused_self,
|
clippy::unused_self,
|
||||||
clippy::unwrap_used,
|
clippy::unwrap_used,
|
||||||
clippy::use_debug,
|
clippy::use_debug,
|
||||||
|
|||||||
Reference in New Issue
Block a user