From 5d48a5c5b46e2616c0d52f1869f2f49b25df615f Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 20 Sep 2025 14:47:35 -0700 Subject: [PATCH] chore(clippy): apply latest fixes --- komorebi-bar/src/config.rs | 2 +- komorebi/src/animation/engine.rs | 2 +- komorebi/src/core/arrangement.rs | 2 +- komorebi/src/core/direction.rs | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/komorebi-bar/src/config.rs b/komorebi-bar/src/config.rs index 9b29a3f4..9567e73a 100644 --- a/komorebi-bar/src/config.rs +++ b/komorebi-bar/src/config.rs @@ -453,7 +453,7 @@ impl MouseMessage { tracing::debug!("Sending messages: {messages:?}"); - if komorebi_client::send_batch(messages.into_iter()).is_err() { + if komorebi_client::send_batch(messages).is_err() { tracing::error!("could not send commands"); } } diff --git a/komorebi/src/animation/engine.rs b/komorebi/src/animation/engine.rs index bc0c7eba..87f7a12f 100644 --- a/komorebi/src/animation/engine.rs +++ b/komorebi/src/animation/engine.rs @@ -55,7 +55,7 @@ impl AnimationEngine { #[allow(clippy::cast_precision_loss)] pub fn animate( - render_dispatcher: (impl RenderDispatcher + Send + 'static), + render_dispatcher: impl RenderDispatcher + Send + 'static, duration: Duration, ) -> Result<()> { std::thread::spawn(move || { diff --git a/komorebi/src/core/arrangement.rs b/komorebi/src/core/arrangement.rs index 360336ea..c1c46b84 100644 --- a/komorebi/src/core/arrangement.rs +++ b/komorebi/src/core/arrangement.rs @@ -927,7 +927,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 fc723c55..b42f8b5d 100644 --- a/komorebi/src/core/direction.rs +++ b/komorebi/src/core/direction.rs @@ -105,7 +105,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, @@ -125,7 +125,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, @@ -149,7 +149,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 @@ -193,7 +193,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