mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-14 19:26:51 -04:00
fmt: rustfmt the #1547 save path and test
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA
This commit is contained in:
2 files changed
+3
-4
No files matched your search
@@ -146,9 +146,8 @@ impl Headless {
|
||||
// record the current revision as saved so the session stops reporting `dirty`, and make
|
||||
// the file the document's path. A flat export (PNG, JPEG, …) is a copy and leaves both
|
||||
// alone (#1547).
|
||||
let ext = format
|
||||
.map(|f| f.trim_start_matches('.').to_ascii_lowercase())
|
||||
.or_else(|| target.extension().map(|e| e.to_string_lossy().to_ascii_lowercase()));
|
||||
let ext =
|
||||
format.map(|f| f.trim_start_matches('.').to_ascii_lowercase()).or_else(|| target.extension().map(|e| e.to_string_lossy().to_ascii_lowercase()));
|
||||
let layered = matches!(ext.as_deref(), Some("psd" | "psb")) || ext.as_deref() == Some(photocraft_format::EXTENSION);
|
||||
if layered {
|
||||
// Saving by index must not retarget the next automation command.
|
||||
|
||||
@@ -79,4 +79,4 @@ fn a_flat_export_is_a_copy_and_leaves_the_document_dirty() {
|
||||
headless.handle("doc.save", json!({})).unwrap();
|
||||
assert!(!headless.session.active().unwrap().is_dirty());
|
||||
std::fs::remove_dir_all(dir).unwrap();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user