buildFHSEnv: clippy

This commit is contained in:
K900
2025-07-27 14:37:29 +03:00
parent 246199e411
commit c259a15f70
@@ -141,7 +141,7 @@ fn collect_candidate_paths(
// could be a broken symlink, that's fine, we still want to handle those
Some(_) => e
.path()
.ok_or_else(|| anyhow!("I/O error when walking {path:?}"))?
.ok_or_else(|| anyhow!("I/O error when walking {}", path.display()))?
.into(),
None => {
// symlink loop
@@ -263,12 +263,20 @@ fn build_env(out: &Path, plan: HashMap<PathBuf, PathBuf>) -> anyhow::Result<()>
.parent()
.ok_or(anyhow!("destination directory is root"))
.with_context(|| {
format!("When trying to determine destination directory for {full_dest:?}")
format!(
"When trying to determine destination directory for {}",
full_dest.display()
)
})?;
fs::create_dir_all(dest_dir)
.with_context(|| format!("When trying to create directory {dest_dir:?}"))?;
ufs::symlink(&src, &full_dest)
.with_context(|| format!("When symlinking {src:?} to {full_dest:?}"))?;
.with_context(|| format!("When trying to create directory {}", dest_dir.display()))?;
ufs::symlink(&src, &full_dest).with_context(|| {
format!(
"When symlinking {} to {}",
src.display(),
full_dest.display()
)
})?;
}
let marker = out.join(FHSENV_MARKER_FILE);
@@ -298,7 +306,7 @@ fn main() -> anyhow::Result<()> {
paths = extend_to_closure(paths, &refs)?;
paths32 = extend_to_closure(paths32, &refs)?;
};
}
let plan = build_plan(paths, paths32)?;