tidy bindings, closures and string building

This commit is contained in:
2026-09-21 01:31:16 +03:00
parent c7a4721e7d
commit 3f50fdd337
3 changed files with 14 additions and 10 deletions
+4 -2
View File
@@ -1089,7 +1089,8 @@ pub(crate) fn concat_pcm(segments: &[PathBuf], output: &Path) -> Result<()> {
}
let mut out = std::fs::File::create(output).context("creating audio concat file")?;
for seg in segments {
let mut f = std::fs::File::open(seg).with_context(|| format!("opening {seg:?}"))?;
let mut f = std::fs::File::open(seg)
.with_context(|| format!("opening {}", seg.display()))?;
std::io::copy(&mut f, &mut out).context("copying audio segment")?;
}
out.flush()?;
@@ -1123,7 +1124,8 @@ pub(crate) fn concat_segments(ffmpeg: &Path, segments: &[PathBuf], output: &Path
.to_str()
.ok_or_else(|| anyhow!("segment path is not UTF-8"))?
.replace('\\', "/");
body.push_str(&format!("file '{s}'\n"));
use std::fmt::Write as _;
let _ = writeln!(body, "file '{s}'");
}
std::fs::write(&list_path, body).context("writing concat list")?;