mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-27 06:25:42 +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
|
} else if new_pane_geom.x + new_pane_geom.cols.as_usize() + extra_width
|
||||||
< max_right_coords
|
< max_right_coords
|
||||||
{
|
{
|
||||||
new_pane_geom.x = new_pane_geom.x + extra_width;
|
new_pane_geom.x += extra_width;
|
||||||
} else {
|
} else {
|
||||||
new_pane_geom.x =
|
new_pane_geom.x =
|
||||||
max_right_coords.saturating_sub(new_pane_geom.cols.as_usize());
|
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
|
} else if new_pane_geom.y + new_pane_geom.rows.as_usize() + extra_height
|
||||||
< max_bottom_coords
|
< max_bottom_coords
|
||||||
{
|
{
|
||||||
new_pane_geom.y = new_pane_geom.y + extra_height;
|
new_pane_geom.y += extra_height;
|
||||||
} else {
|
} else {
|
||||||
new_pane_geom.y =
|
new_pane_geom.y =
|
||||||
max_bottom_coords.saturating_sub(new_pane_geom.rows.as_usize());
|
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,
|
geom: &PaneGeom,
|
||||||
existing_geoms: &[PaneGeom],
|
existing_geoms: &[PaneGeom],
|
||||||
) -> bool {
|
) -> bool {
|
||||||
pane_geom_is_inside_viewport(viewport, geom)
|
pane_geom_is_inside_viewport(viewport, geom) && !existing_geoms.iter().any(|p| p == geom)
|
||||||
&& !existing_geoms.iter().find(|p| *p == geom).is_some()
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user