From 3028b5328cca7f539bfec925b2d85561a37f0cfa Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 01:45:29 -0500 Subject: [PATCH] Format shared registry dispatch --- crates/engine/src/cmd/book.rs | 6 +++++- crates/ui-egui/src/app/files.rs | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/book.rs b/crates/engine/src/cmd/book.rs index 2b171d388..7a3995093 100644 --- a/crates/engine/src/cmd/book.rs +++ b/crates/engine/src/cmd/book.rs @@ -130,7 +130,11 @@ impl ChapterBatch { fn writable_chapter(s: &Session, path: &str, command: &'static str) -> Result<()> { use std::path::Path; - if Path::new(path).extension().and_then(std::ffi::OsStr::to_str).is_some_and(|ext| craft_file_formats::from_extension(ext) == Some(craft_file_formats::Format::Idml)) { + if Path::new(path) + .extension() + .and_then(std::ffi::OsStr::to_str) + .is_some_and(|ext| craft_file_formats::from_extension(ext) == Some(craft_file_formats::Format::Idml)) + { return Err(bad(command, format!("cannot change imported IDML chapter {path}; convert it to a native DesignCraft document first"))); } let target = crate::io::canonicalize(path).map_err(|e| EngineError::Other(format!("{path}: {e}")))?; diff --git a/crates/ui-egui/src/app/files.rs b/crates/ui-egui/src/app/files.rs index 61f0f9bbe..79353dcf6 100644 --- a/crates/ui-egui/src/app/files.rs +++ b/crates/ui-egui/src/app/files.rs @@ -139,8 +139,8 @@ impl DesignApp { } let layout = opens_as_document(&file.name) || (std::path::Path::new(&file.name).extension().is_none() && designcraft_engine::cmd::is_document(&file.bytes)); - let place = - file.request.purpose == "place" || (matches!(file.request.purpose.as_str(), "drop" | "open") && !layout && format != Some(craft_file_formats::Format::Ase)); + let place = file.request.purpose == "place" + || (matches!(file.request.purpose.as_str(), "drop" | "open") && !layout && format != Some(craft_file_formats::Format::Ase)); if place || format == Some(craft_file_formats::Format::Ase) || file.request.purpose == "swatches" { self.activate_import_target(&file.request)?; }