mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-08 20:10:32 +00:00
address review: report output-name exhaustion per file in create_separate
This commit is contained in:
@@ -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 }),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user