mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-26 22:15:19 +03:00
fix(style0: simplify find(..).is_some()
to any(..)
and use +=
instead (#1081)
This commit is contained in:
parent
1562672877
commit
31def4102f
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user