1 parent 8b34d9c commit 1585a22Copy full SHA for 1585a22
1 file changed
src/helpers.rs
@@ -118,7 +118,7 @@ pub enum GlobError {
118
pub fn glob_from_vec(from: &[String], postfix: Option<&str>) -> miette::Result<Any<'static>> {
119
from
120
.iter()
121
- .map(|g| if let Some(postfix) = postfix { format!("{g}{postfix}") } else { g.to_string() })
+ .map(|g| postfix.map_or_else(|| g.to_string(), |postfix| format!("{g}{postfix}")))
122
.map(|g| Glob::new(&g).map(Glob::into_owned).map_err(|e| GlobError::Build(BuildError::into_owned(e))))
123
.collect_vec()
124
.pipe(join_err_result)?
0 commit comments