clippy

Max Brunsfeld created

Change summary

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(-)

Detailed changes

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()

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::<f32>() - inner.len() as f32).abs() >= 0.001 {
             panic!(
                 "flex values out of bounds: {:?}",

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 {