diff --git a/crates/automation/src/headless.rs b/crates/automation/src/headless.rs index 736c4d2901e..51b0a9bc9b3 100644 --- a/crates/automation/src/headless.rs +++ b/crates/automation/src/headless.rs @@ -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. diff --git a/crates/automation/tests/layered_save_dirty.rs b/crates/automation/tests/layered_save_dirty.rs index 0a19277f40c..731a52e850f 100644 --- a/crates/automation/tests/layered_save_dirty.rs +++ b/crates/automation/tests/layered_save_dirty.rs @@ -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(); -} \ No newline at end of file +}