From 120b45b972ae167570d4f1e17ab4bc68d6953a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20S=C3=A1lyi?= Date: Tue, 8 Apr 2025 17:20:10 +0200 Subject: [PATCH] Fix clippy warnings --- src/compositors.rs | 5 +++-- src/compositors/niri.rs | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/compositors.rs b/src/compositors.rs index e6ce740..f734ce6 100644 --- a/src/compositors.rs +++ b/src/compositors.rs @@ -67,7 +67,7 @@ impl Compositor { // } /// abstract 'sending back workspace change events' -pub (self) struct EventSender { +struct EventSender { tx: Sender, waker: Arc, } @@ -82,7 +82,8 @@ impl EventSender { self.waker.wake().unwrap(); } } -pub (self) trait CompositorInterface: Send + Sync { + +trait CompositorInterface: Send + Sync { fn request_visible_workspaces(&mut self) -> Vec; fn subscribe_event_loop(self, event_sender: EventSender); } diff --git a/src/compositors/niri.rs b/src/compositors/niri.rs index efc04bb..0ad99ab 100644 --- a/src/compositors/niri.rs +++ b/src/compositors/niri.rs @@ -32,14 +32,14 @@ impl CompositorInterface for NiriConnectionTask { .expect("failed to connect to niri socket") .send(Request::Workspaces) { - return workspaces + workspaces .into_iter() .filter(|w| w.is_active) .map(|workspace| WorkspaceVisible { - output: workspace.output.unwrap_or_else(String::new), - workspace_name: workspace.name.unwrap_or_else(String::new), + output: workspace.output.unwrap_or_default(), + workspace_name: workspace.name.unwrap_or_default(), }) - .collect(); + .collect() } else { panic!("unable to retrieve niri workspaces") }