From a8de084a85c4af18d3dc35d7e0655d5c44f4ca01 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Mon, 22 Sep 2025 15:06:39 -0700 Subject: [PATCH] refactor(clippy): apply rustc 1.90.0 lints --- komorebi/src/core/arrangement.rs | 2 +- komorebi/src/core/direction.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/komorebi/src/core/arrangement.rs b/komorebi/src/core/arrangement.rs index c4915e06..60a67ae0 100644 --- a/komorebi/src/core/arrangement.rs +++ b/komorebi/src/core/arrangement.rs @@ -784,7 +784,7 @@ fn recursive_fibonacci( right: resized.right, bottom: resized.bottom, }] - } else if idx % 2 != 0 { + } else if !idx.is_multiple_of(2) { let mut res = vec![Rect { left: resized.left, top: main_y, diff --git a/komorebi/src/core/direction.rs b/komorebi/src/core/direction.rs index 2d8238f0..6df24716 100644 --- a/komorebi/src/core/direction.rs +++ b/komorebi/src/core/direction.rs @@ -101,7 +101,7 @@ impl Direction for DefaultLayout { Self::Scrolling => false, }, OperationDirection::Down => match self { - Self::BSP => idx != count - 1 && idx % 2 != 0, + Self::BSP => idx != count - 1 && !idx.is_multiple_of(2), Self::Columns => false, Self::Rows => idx != count - 1, Self::VerticalStack | Self::RightMainVerticalStack => idx != 0 && idx != count - 1, @@ -121,7 +121,7 @@ impl Direction for DefaultLayout { Self::Scrolling => idx != 0, }, OperationDirection::Right => match self { - Self::BSP => idx % 2 == 0 && idx != count - 1, + Self::BSP => idx.is_multiple_of(2) && idx != count - 1, Self::Columns => idx != count - 1, Self::Rows => false, Self::VerticalStack => idx == 0, @@ -145,7 +145,7 @@ impl Direction for DefaultLayout { ) -> usize { match self { Self::BSP => { - if idx % 2 == 0 { + if idx.is_multiple_of(2) { idx - 1 } else { idx - 2 @@ -189,7 +189,7 @@ impl Direction for DefaultLayout { ) -> usize { match self { Self::BSP => { - if idx % 2 == 0 { + if idx.is_multiple_of(2) { idx - 2 } else { idx - 1