address review: report output-name exhaustion per file in create_separate

This commit is contained in:
Dylan M. Taylor
2026-11-04 01:49:00 +00:00
parent d2d032a76e
commit cdcb05d414
+8 -5
View File
@@ -227,11 +227,14 @@ impl Automation {
});
out.push(match converted {
Ok((pdfcraft_engine::SourceKind::Pdf, ..)) => json!({ "path": p, "skipped": "already a PDF" }),
Ok((_, stem, pdf)) => {
let target = unused(&dir, &stem)?;
write_atomic(&target, &pdf)?;
json!({ "path": p, "output": target.to_string_lossy(), "bytes": pdf.len() })
}
// every numbered name taken is this file's failure, not the whole call's
Ok((_, stem, pdf)) => match unused(&dir, &stem) {
Ok(target) => {
write_atomic(&target, &pdf)?;
json!({ "path": p, "output": target.to_string_lossy(), "bytes": pdf.len() })
}
Err(e) => json!({ "path": p, "error": e.to_string() }),
},
Err(e) => json!({ "path": p, "error": e }),
});
}