From d81c61a3486f41a0ff8fc45715b84db68ffed61c Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 11 Mar 2026 18:09:40 -0700 Subject: [PATCH] clippy --- crates/workspace/src/dock.rs | 18 ++++++------------ crates/workspace/src/pane_group.rs | 10 +++++++--- crates/workspace/src/workspace.rs | 1 - 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs index 28b5a4dbcd62033d750bb7585dc79d7e6aaba85c..0c655415e750f4fab4ff009156515660e50d5b56 100644 --- a/crates/workspace/src/dock.rs +++ b/crates/workspace/src/dock.rs @@ -829,19 +829,13 @@ impl Render for Dock { .cached(StyleRefinement::default().v_flex().size_full()); let position = self.position; - let create_resize_handle = |is_flex_content: bool| { + let create_resize_handle = || { let handle = div() .id("resize-handle") - .on_drag( - DraggedDock { - position, - is_flex_content, - }, - |dock, _, _, cx| { - cx.stop_propagation(); - cx.new(|_| dock.clone()) - }, - ) + .on_drag(DraggedDock { position }, |dock, _, _, cx| { + cx.stop_propagation(); + cx.new(|_| dock.clone()) + }) .on_mouse_down( MouseButton::Left, cx.listener(|_, _: &MouseDownEvent, _, cx| { @@ -917,7 +911,7 @@ impl Render for Dock { DockPosition::Bottom => this.border_t_1(), }) .when(self.resizable(cx), |this| { - this.child(create_resize_handle(false)) + this.child(create_resize_handle()) }) } else { div() diff --git a/crates/workspace/src/pane_group.rs b/crates/workspace/src/pane_group.rs index 692113620ac2bad3d745b9822f693b0effb1e278..8d7c206e8b77895d5c770e683fdfc8765ca0a251 100644 --- a/crates/workspace/src/pane_group.rs +++ b/crates/workspace/src/pane_group.rs @@ -895,9 +895,9 @@ impl PaneAxis { }; if ix + 1 == state.entries.len() { - apply_changes(ix - 1, -1.0 * amount, &mut *state); + apply_changes(ix - 1, -1.0 * amount, &mut state); } else { - apply_changes(ix, amount, &mut *state); + apply_changes(ix, amount, &mut state); } Some(true) } @@ -1200,6 +1200,8 @@ pub mod element { Axis::Horizontal => px(HORIZONTAL_MIN_SIZE), Axis::Vertical => px(VERTICAL_MIN_SIZE), }; + + #[cfg(debug_assertions)] check_flex_values_in_bounds(entries); // Math to convert a flex value to a pixel value @@ -1367,6 +1369,8 @@ pub mod element { let len = self.children.len(); debug_assert!(entries.len() == len); + + #[cfg(debug_assertions)] check_flex_values_in_bounds(entries); let total_flex = len as f32; @@ -1574,8 +1578,8 @@ pub mod element { } } + #[cfg(debug_assertions)] fn check_flex_values_in_bounds(inner: &[PaneAxisStateEntry]) { - #[cfg(debug_assertions)] if (inner.iter().map(|e| e.flex).sum::() - inner.len() as f32).abs() >= 0.001 { panic!( "flex values out of bounds: {:?}", diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 86e336cd25eaafec4326a5b735dfd06c85e66d2f..b46dfa59f3322eda173541ec039fb438fd03fe91 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -7590,7 +7590,6 @@ impl Focusable for Workspace { #[derive(Clone)] struct DraggedDock { position: DockPosition, - is_flex_content: bool, } impl Render for DraggedDock {