From d29069398b4b12c20a4f0c722b2442186df8e0ac Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 21 Jul 2026 10:50:26 -0700 Subject: [PATCH] chore(cargo): address clippy warnings --- Cargo.lock | 20 ++++---------------- komorebi-bar/src/selected_frame.rs | 8 ++++---- komorebi-bar/src/widgets/applications.rs | 2 +- komorebi-bar/src/widgets/komorebi.rs | 6 +++--- komorebi-bar/src/widgets/komorebi_layout.rs | 2 +- komorebi-bar/src/widgets/time.rs | 2 +- komorebi/src/process_command.rs | 4 +--- komorebi/src/stackbar_manager/mod.rs | 2 +- 8 files changed, 16 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 899a3b24..f9ab55b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1351,7 +1351,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0b1fab2ae45819af2d0731d60f2afe17227ebb1a1538a236da84c93e9a60162" dependencies = [ "dispatch2", - "nix 0.31.3", + "nix", "windows-sys 0.61.2", ] @@ -3909,18 +3909,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "nix" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" -dependencies = [ - "bitflags 2.13.0", - "cfg-if 1.0.4", - "cfg_aliases", - "libc", -] - [[package]] name = "nix" version = "0.31.3" @@ -4396,7 +4384,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "dispatch2", "libc", @@ -4693,7 +4681,7 @@ checksum = "9cf20a545b305cf1da722b236b5155c9bb35f1d5ceb28c048bd96ca842f41b5b" dependencies = [ "android_system_properties", "log", - "nix 0.31.3", + "nix", "objc2 0.6.4", "objc2-foundation 0.3.2", "objc2-ui-kit 0.3.2", @@ -6146,7 +6134,7 @@ dependencies = [ "lazycell", "libc", "mach2", - "nix 0.31.2", + "nix", "num-traits", "objc2-core-foundation", "objc2-io-kit", diff --git a/komorebi-bar/src/selected_frame.rs b/komorebi-bar/src/selected_frame.rs index 6a9347e1..6e5efce0 100644 --- a/komorebi-bar/src/selected_frame.rs +++ b/komorebi-bar/src/selected_frame.rs @@ -50,7 +50,7 @@ impl SelectableFrame { let visuals = ui.style().interact_selectable(&response, selected); Frame::NONE - .stroke(Stroke::new(1.0, visuals.bg_stroke.color)) + .stroke(Stroke::new(1.0_f32, visuals.bg_stroke.color)) .corner_radius(visuals.corner_radius) .fill(selected_fill.unwrap_or(visuals.bg_fill)) .inner_margin(inner_margin) @@ -59,7 +59,7 @@ impl SelectableFrame { let visuals = ui.style().interact_selectable(&response, selected); Frame::NONE - .stroke(Stroke::new(1.0, visuals.bg_stroke.color)) + .stroke(Stroke::new(1.0_f32, visuals.bg_stroke.color)) .corner_radius(visuals.corner_radius) .fill(visuals.bg_fill) .inner_margin(inner_margin) @@ -68,14 +68,14 @@ impl SelectableFrame { let visuals = ui.style().interact_selectable(&response, selected); Frame::NONE - .stroke(Stroke::new(1.0, visuals.bg_fill)) + .stroke(Stroke::new(1.0_f32, visuals.bg_fill)) .corner_radius(visuals.corner_radius) .fill(selected_fill.unwrap_or(visuals.bg_fill)) .inner_margin(inner_margin) .show(ui, add_contents); } else { Frame::NONE - .stroke(Stroke::new(1.0, Color32::TRANSPARENT)) + .stroke(Stroke::new(1.0_f32, Color32::TRANSPARENT)) .inner_margin(inner_margin) .show(ui, add_contents); } diff --git a/komorebi-bar/src/widgets/applications.rs b/komorebi-bar/src/widgets/applications.rs index 65adfc84..20bc1fe3 100644 --- a/komorebi-bar/src/widgets/applications.rs +++ b/komorebi-bar/src/widgets/applications.rs @@ -312,7 +312,7 @@ impl Icon { #[inline] pub fn draw_fallback(ui: &mut Ui, icon_size: Vec2) { let (response, painter) = ui.allocate_painter(icon_size, Sense::hover()); - let stroke = Stroke::new(1.0, ui.style().visuals.text_color()); + let stroke = Stroke::new(1.0_f32, ui.style().visuals.text_color()); let mut rect = response.rect; let rounding = CornerRadius::same((rect.width() * 0.1) as u8); rect = rect.shrink(stroke.width); diff --git a/komorebi-bar/src/widgets/komorebi.rs b/komorebi-bar/src/widgets/komorebi.rs index 9a964625..a9a3a1f1 100644 --- a/komorebi-bar/src/widgets/komorebi.rs +++ b/komorebi-bar/src/widgets/komorebi.rs @@ -467,7 +467,7 @@ impl WorkspacesBar { fn show_fallback_icon(&self, ctx: &Context, ui: &mut Ui, ws: &WorkspaceInfo) -> Response { let (response, painter) = ui.allocate_painter(self.icon_size, Sense::hover()); let stroke: Stroke = Stroke::new( - 1.0, + 1.0_f32, if ws.is_selected { ctx.style().visuals.selection.stroke.color } else { @@ -629,7 +629,7 @@ impl WorkspaceLayerBar { if matches!(layer, WorkspaceLayer::Tiling) { let (response, painter) = ui.allocate_painter(size, Sense::hover()); let color = ctx.style().visuals.selection.stroke.color; - let stroke = Stroke::new(1.0, color); + let stroke = Stroke::new(1.0_f32, color); let mut rect = response.rect; let corner = CornerRadius::same((rect.width() * 0.1) as u8); rect = rect.shrink(stroke.width); @@ -652,7 +652,7 @@ impl WorkspaceLayerBar { } else { let (response, painter) = ui.allocate_painter(size, Sense::hover()); let color = ctx.style().visuals.selection.stroke.color; - let stroke = Stroke::new(1.0, color); + let stroke = Stroke::new(1.0_f32, color); let mut rect = response.rect; let corner = CornerRadius::same((rect.width() * 0.1) as u8); rect = rect.shrink(stroke.width); diff --git a/komorebi-bar/src/widgets/komorebi_layout.rs b/komorebi-bar/src/widgets/komorebi_layout.rs index f2f189a1..5c35246c 100644 --- a/komorebi-bar/src/widgets/komorebi_layout.rs +++ b/komorebi-bar/src/widgets/komorebi_layout.rs @@ -148,7 +148,7 @@ impl KomorebiLayout { } else { ui.style().visuals.text_color() }; - let stroke = Stroke::new(1.0, color); + let stroke = Stroke::new(1.0_f32, color); let mut rect = response.rect; let rounding = CornerRadius::same((rect.width() * 0.1) as u8); rect = rect.shrink(stroke.width); diff --git a/komorebi-bar/src/widgets/time.rs b/komorebi-bar/src/widgets/time.rs index 2f80f7b5..0dd75299 100644 --- a/komorebi-bar/src/widgets/time.rs +++ b/komorebi-bar/src/widgets/time.rs @@ -316,7 +316,7 @@ impl Time { let (response, painter) = ui.allocate_painter(Vec2::new(width, full_height + offset * 2.0), Sense::hover()); let color = ctx.style().visuals.text_color(); - let stroke = Stroke::new(1.0, color); + let stroke = Stroke::new(1.0_f32, color); let round_all = CornerRadius::same((response.rect.width() * 0.1) as u8); let round_top = CornerRadius { diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index b1ee3d88..81c384cd 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -3,7 +3,6 @@ use color_eyre::eyre::OptionExt; use color_eyre::eyre::WrapErr; use komorebi_themes::colour::Rgb; use miow::pipe::connect; -use net2::TcpStreamExt; use parking_lot::Mutex; use std::collections::HashMap; use std::fs::File; @@ -154,8 +153,7 @@ pub fn listen_for_commands_tcp(wm: Arc>, port: usize) { for client in listener.incoming() { match client { Ok(mut stream) => { - stream - .set_keepalive(Some(Duration::from_secs(30))) + net2::TcpStreamExt::set_keepalive(&stream, Some(Duration::from_secs(30))) .expect("TCP keepalive should be set"); let addr = stream diff --git a/komorebi/src/stackbar_manager/mod.rs b/komorebi/src/stackbar_manager/mod.rs index 7e5a6bc9..fe56b941 100644 --- a/komorebi/src/stackbar_manager/mod.rs +++ b/komorebi/src/stackbar_manager/mod.rs @@ -101,7 +101,7 @@ pub fn handle_notifications(wm: Arc>) -> color_eyre::Result if matches!(STACKBAR_MODE.load(), StackbarMode::Never) || STACKBAR_TEMPORARILY_DISABLED.load(Ordering::SeqCst) { - for (_, stackbar) in stackbars.iter() { + for stackbar in stackbars.values() { stackbar.destroy()?; }