chore(clippy): apply latest fixes

This commit is contained in:
LGUG2Z
2025-09-20 14:47:35 -07:00
parent 539aeec965
commit 5d48a5c5b4
4 changed files with 7 additions and 7 deletions

View File

@@ -453,7 +453,7 @@ impl MouseMessage {
tracing::debug!("Sending messages: {messages:?}"); 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"); tracing::error!("could not send commands");
} }
} }

View File

@@ -55,7 +55,7 @@ impl AnimationEngine {
#[allow(clippy::cast_precision_loss)] #[allow(clippy::cast_precision_loss)]
pub fn animate( pub fn animate(
render_dispatcher: (impl RenderDispatcher + Send + 'static), render_dispatcher: impl RenderDispatcher + Send + 'static,
duration: Duration, duration: Duration,
) -> Result<()> { ) -> Result<()> {
std::thread::spawn(move || { std::thread::spawn(move || {

View File

@@ -927,7 +927,7 @@ fn recursive_fibonacci(
right: resized.right, right: resized.right,
bottom: resized.bottom, bottom: resized.bottom,
}] }]
} else if idx % 2 != 0 { } else if !idx.is_multiple_of(2) {
let mut res = vec![Rect { let mut res = vec![Rect {
left: resized.left, left: resized.left,
top: main_y, top: main_y,

View File

@@ -105,7 +105,7 @@ impl Direction for DefaultLayout {
Self::Scrolling => false, Self::Scrolling => false,
}, },
OperationDirection::Down => match self { 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::Columns => false,
Self::Rows => idx != count - 1, Self::Rows => idx != count - 1,
Self::VerticalStack | Self::RightMainVerticalStack => idx != 0 && idx != count - 1, Self::VerticalStack | Self::RightMainVerticalStack => idx != 0 && idx != count - 1,
@@ -125,7 +125,7 @@ impl Direction for DefaultLayout {
Self::Scrolling => idx != 0, Self::Scrolling => idx != 0,
}, },
OperationDirection::Right => match self { 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::Columns => idx != count - 1,
Self::Rows => false, Self::Rows => false,
Self::VerticalStack => idx == 0, Self::VerticalStack => idx == 0,
@@ -149,7 +149,7 @@ impl Direction for DefaultLayout {
) -> usize { ) -> usize {
match self { match self {
Self::BSP => { Self::BSP => {
if idx % 2 == 0 { if idx.is_multiple_of(2) {
idx - 1 idx - 1
} else { } else {
idx - 2 idx - 2
@@ -193,7 +193,7 @@ impl Direction for DefaultLayout {
) -> usize { ) -> usize {
match self { match self {
Self::BSP => { Self::BSP => {
if idx % 2 == 0 { if idx.is_multiple_of(2) {
idx - 2 idx - 2
} else { } else {
idx - 1 idx - 1