From a0facd60af4be004ce86303d9bdb220830d1e7bc Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 14 Oct 2026 15:10:48 -0400 Subject: [PATCH] Fix up merged PRs: cargo fmt, and the write_file tests may unwrap Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/file.rs | 2 ++ crates/engine/src/tools.rs | 7 +------ crates/ui-egui/src/backstage.rs | 6 +----- crates/ui-egui/src/lib.rs | 5 +---- crates/ui-egui/src/panes.rs | 7 +++++-- crates/ui-egui/src/sorter.rs | 2 +- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index b0b76f29..127ae31f 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -643,6 +643,8 @@ mod color_at_tests; #[cfg(all(test, not(target_arch = "wasm32")))] mod tests { + #![allow(clippy::unwrap_used, clippy::expect_used)] + use super::write_file; fn scratch(name: &str) -> std::path::PathBuf { diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index 9c0dcabc..73f41ffb 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1064,12 +1064,7 @@ impl Session { || matches!( self.hit_test(p, tol), Some( - Hit::Resize { .. } - | Hit::Rotate { .. } - | Hit::Adjust { .. } - | Hit::Frame { .. } - | Hit::TableColumn { .. } - | Hit::TableRow { .. } + Hit::Resize { .. } | Hit::Rotate { .. } | Hit::Adjust { .. } | Hit::Frame { .. } | Hit::TableColumn { .. } | Hit::TableRow { .. } ) ) { diff --git a/crates/ui-egui/src/backstage.rs b/crates/ui-egui/src/backstage.rs index fa413c74..9eb50898 100644 --- a/crates/ui-egui/src/backstage.rs +++ b/crates/ui-egui/src/backstage.rs @@ -613,11 +613,7 @@ fn recent_list(app: &mut SlideApp, ui: &mut Ui, query: &str, limit: usize) { p.text(pos2(visible_right - 82.0, rect.center().y), Align2::RIGHT_CENTER, "(missing)", theme::font(11.0), t.text_dim); } } - let resp = if missing { - resp.on_hover_text(format!("{path} — this file can't be found")) - } else { - resp.on_hover_text(&path) - }; + let resp = if missing { resp.on_hover_text(format!("{path} — this file can't be found")) } else { resp.on_hover_text(&path) }; // Remove from the list: a real labelled widget on top of the row, with a code-drawn icon // (a text glyph would need a font that has it). let x = ui.allocate_rect( diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 34545650..3b67ea71 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1943,10 +1943,7 @@ mod tests { harness.get_by_label("missing.deckcraft").click(); harness.run_steps(2); assert!(harness.state().toast.is_some(), "the open error was raised"); - assert!( - harness.get_all_by_label_contains("missing.deckcraft").count() >= 2, - "the open error is drawn on the page, next to the entry" - ); + assert!(harness.get_all_by_label_contains("missing.deckcraft").count() >= 2, "the open error is drawn on the page, next to the entry"); } /// #172: a Recent entry can be removed from the list. diff --git a/crates/ui-egui/src/panes.rs b/crates/ui-egui/src/panes.rs index 76cde256..89ea94a4 100644 --- a/crates/ui-egui/src/panes.rs +++ b/crates/ui-egui/src/panes.rs @@ -1096,8 +1096,11 @@ fn designer(app: &mut SlideApp, ui: &mut Ui) { idx, &deckcraft_render::RenderOpts { scale: px as f64 / d.slide_size.width.max(1.0), size: Some((px, h)), ..Default::default() }, ); - let tex = - ui.ctx().load_texture(format!("idea-{name}"), crate::textures::to_color_image(&img, false), crate::textures::editor_texture_options()); + let tex = ui.ctx().load_texture( + format!("idea-{name}"), + crate::textures::to_color_image(&img, false), + crate::textures::editor_texture_options(), + ); cache.tex.push((name, tex, px, h)); }; for (id, _) in &ideas { diff --git a/crates/ui-egui/src/sorter.rs b/crates/ui-egui/src/sorter.rs index 92d6d2e9..28b4b1a5 100644 --- a/crates/ui-egui/src/sorter.rs +++ b/crates/ui-egui/src/sorter.rs @@ -6,9 +6,9 @@ use deckcraft_model::{Presentation, SlideId}; use egui::{Align2, Color32, CornerRadius, Rect, Sense, Stroke, Ui, WidgetInfo, WidgetType, pos2, vec2}; use serde_json::json; +use crate::SlideApp; use crate::icons::{self, Icon}; use crate::theme::{self, Tokens}; -use crate::SlideApp; /// Sorter-only state. Nothing here is part of the document. #[derive(Debug, Default)]