From 6910a12f71e660658c370087ac13dfbccaf4794b Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Wed, 9 Sep 2026 15:39:17 +0000 Subject: [PATCH] Drop redundant conversions, assertions and struct updates --- .../portfolio/document/document_message_handler.rs | 3 +-- .../gizmos/shape_gizmos/spiral_turns_handle.rs | 2 ++ .../tool/common_functionality/shapes/shape_utility.rs | 7 ++----- .../common_functionality/snapping/distribution_snapper.rs | 1 - .../src/vector/algorithms/merge_by_distance.rs | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/editor/src/messages/portfolio/document/document_message_handler.rs b/editor/src/messages/portfolio/document/document_message_handler.rs index 266c1afffa..7f8941df2f 100644 --- a/editor/src/messages/portfolio/document/document_message_handler.rs +++ b/editor/src/messages/portfolio/document/document_message_handler.rs @@ -4164,9 +4164,8 @@ mod document_message_handler_tests { .await; // The operation completed without crashing - // Verifying application still functions by performing another operation + // Verifying application still functions by performing another operation, which panics if the folder move left the editor broken editor.handle_message(DocumentMessage::CreateEmptyFolder).await; - assert!(true, "Application didn't crash after folder move operation"); } // Merging nodes whose output isn't wired downstream produces an encapsulating subnetwork with no exports. diff --git a/editor/src/messages/tool/common_functionality/gizmos/shape_gizmos/spiral_turns_handle.rs b/editor/src/messages/tool/common_functionality/gizmos/shape_gizmos/spiral_turns_handle.rs index 95825c2691..7209470528 100644 --- a/editor/src/messages/tool/common_functionality/gizmos/shape_gizmos/spiral_turns_handle.rs +++ b/editor/src/messages/tool/common_functionality/gizmos/shape_gizmos/spiral_turns_handle.rs @@ -69,6 +69,8 @@ impl SpiralTurns { self.handle_state == SpiralTurnsState::Dragging } + // Records one snapshot of the spiral's parameters; grouping them would only move the same fields into a struct + #[allow(clippy::too_many_arguments)] pub fn store_initial_parameters( &mut self, layer: LayerNodeIdentifier, diff --git a/editor/src/messages/tool/common_functionality/shapes/shape_utility.rs b/editor/src/messages/tool/common_functionality/shapes/shape_utility.rs index 5f0d6da016..a2fdbe09f5 100644 --- a/editor/src/messages/tool/common_functionality/shapes/shape_utility.rs +++ b/editor/src/messages/tool/common_functionality/shapes/shape_utility.rs @@ -88,11 +88,8 @@ impl ShapeType { } pub fn tooltip_description(&self) -> String { - (match self { - // TODO: Add descriptions to all the shape tools - _ => "", - }) - .into() + // TODO: Add descriptions to all the shape tools + String::new() } pub fn icon_name(&self) -> String { diff --git a/editor/src/messages/tool/common_functionality/snapping/distribution_snapper.rs b/editor/src/messages/tool/common_functionality/snapping/distribution_snapper.rs index 543c2280ff..a30c729d68 100644 --- a/editor/src/messages/tool/common_functionality/snapping/distribution_snapper.rs +++ b/editor/src/messages/tool/common_functionality/snapping/distribution_snapper.rs @@ -677,7 +677,6 @@ mod tests { down: [10., 15.].map(|y| Rect::from_square(DVec2::new(0., y), 2.)).to_vec(), left: [-12., -15.].map(|x| Rect::from_square(DVec2::new(x, 0.), 2.)).to_vec(), right: [12., 15.].map(|x| Rect::from_square(DVec2::new(x, 0.), 2.)).to_vec(), - ..Default::default() }; let source = Rect::from_square(DVec2::new(0.3, 0.4), 2.); let snap_results = &mut SnapResults::default(); diff --git a/node-graph/libraries/vector-types/src/vector/algorithms/merge_by_distance.rs b/node-graph/libraries/vector-types/src/vector/algorithms/merge_by_distance.rs index 195cae25e4..a27cefdfa6 100644 --- a/node-graph/libraries/vector-types/src/vector/algorithms/merge_by_distance.rs +++ b/node-graph/libraries/vector-types/src/vector/algorithms/merge_by_distance.rs @@ -47,7 +47,7 @@ impl MergeByDistanceExt for Vector { // Collect points and segments to delete at the end to avoid invalidating indices let mut points_to_delete = FxHashSet::default(); let mut segments_to_delete = FxHashSet::default(); - for (mut collapse_set, average_pos) in collapse.into_iter().zip(average_position.into_iter()) { + for (mut collapse_set, average_pos) in collapse.into_iter().zip(average_position) { // Remove any segments where both endpoints are in the collapse set segments_to_delete.extend(self.segment_domain.iter().filter_map(|(id, start_offset, end_offset, _)| { let start = self.point_domain.ids()[start_offset];