From 31def4102fc5fe029d736ccf9df416f59a1963fe Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Thu, 24 Feb 2022 19:29:56 +0900 Subject: [PATCH] fix(style0: simplify `find(..).is_some()` to `any(..)` and use `+=` instead (#1081) --- zellij-server/src/tab/floating_pane_grid.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zellij-server/src/tab/floating_pane_grid.rs b/zellij-server/src/tab/floating_pane_grid.rs index 2258519f6..182483421 100644 --- a/zellij-server/src/tab/floating_pane_grid.rs +++ b/zellij-server/src/tab/floating_pane_grid.rs @@ -172,7 +172,7 @@ impl<'a> FloatingPaneGrid<'a> { } else if new_pane_geom.x + new_pane_geom.cols.as_usize() + extra_width < max_right_coords { - new_pane_geom.x = new_pane_geom.x + extra_width; + new_pane_geom.x += extra_width; } else { new_pane_geom.x = max_right_coords.saturating_sub(new_pane_geom.cols.as_usize()); @@ -209,7 +209,7 @@ impl<'a> FloatingPaneGrid<'a> { } else if new_pane_geom.y + new_pane_geom.rows.as_usize() + extra_height < max_bottom_coords { - new_pane_geom.y = new_pane_geom.y + extra_height; + new_pane_geom.y += extra_height; } else { new_pane_geom.y = max_bottom_coords.saturating_sub(new_pane_geom.rows.as_usize()); @@ -1238,6 +1238,5 @@ fn pane_geom_is_unoccupied_and_inside_viewport( geom: &PaneGeom, existing_geoms: &[PaneGeom], ) -> bool { - pane_geom_is_inside_viewport(viewport, geom) - && !existing_geoms.iter().find(|p| *p == geom).is_some() + pane_geom_is_inside_viewport(viewport, geom) && !existing_geoms.iter().any(|p| p == geom) }