From 350468f970e37e92a4ef8a46e343dc22dc1f0d66 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Sat, 15 Jun 2024 20:46:39 -0500 Subject: [PATCH] Fix clippy warnings --- api/rust/src/lib.rs | 17 ++++++----------- api/rust/src/snowcap.rs | 1 + snowcap | 2 +- src/main.rs | 17 ++++++++--------- src/state.rs | 4 ++-- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/api/rust/src/lib.rs b/api/rust/src/lib.rs index b842e63..53a2831 100644 --- a/api/rust/src/lib.rs +++ b/api/rust/src/lib.rs @@ -88,12 +88,9 @@ use signal::SignalState; #[cfg(feature = "snowcap")] use snowcap::Snowcap; use tag::Tag; -use tokio::{ - sync::{ - mpsc::{unbounded_channel, UnboundedReceiver}, - RwLock, - }, - task::JoinHandle, +use tokio::sync::{ + mpsc::{unbounded_channel, UnboundedReceiver}, + RwLock, }; use tokio_stream::wrappers::UnboundedReceiverStream; use tonic::transport::{Endpoint, Uri}; @@ -167,7 +164,7 @@ impl std::fmt::Debug for ApiModules { pub struct Receivers { pinnacle: UnboundedReceiver>, #[cfg(feature = "snowcap")] - snowcap: UnboundedReceiver>, + snowcap: UnboundedReceiver>, } /// Connects to Pinnacle and builds the configuration structs. @@ -238,18 +235,16 @@ pub async fn connect() -> Result<(ApiModules, Receivers), Box anyhow::Result<()> { #[cfg(feature = "snowcap")] { + use smithay::reexports::calloop; + use std::sync::{ + atomic::{AtomicBool, Ordering}, + Arc, + }; + info!("Starting Snowcap"); let (ping, source) = calloop::ping::make_ping()?; let ready_flag = Arc::new(AtomicBool::new(false)); @@ -216,7 +215,7 @@ async fn main() -> anyhow::Result<()> { info!("`no-config` option was set, not spawning config"); } - event_loop.run(None, &mut state, |state| { + event_loop.run(Duration::from_secs(1), &mut state, |state| { state.on_event_loop_cycle_completion(); })?; diff --git a/src/state.rs b/src/state.rs index d97a52c..9c1da46 100644 --- a/src/state.rs +++ b/src/state.rs @@ -26,7 +26,7 @@ use smithay::{ input::{keyboard::XkbConfig, pointer::CursorImageStatus, Seat, SeatState}, output::Output, reexports::{ - calloop::{self, generic::Generic, Interest, LoopHandle, LoopSignal, Mode, PostAction}, + calloop::{generic::Generic, Interest, LoopHandle, LoopSignal, Mode, PostAction}, wayland_server::{ backend::{ClientData, ClientId, DisconnectReason, GlobalId}, protocol::wl_surface::WlSurface, @@ -157,7 +157,7 @@ pub struct Pinnacle { pub outputs: IndexMap>, #[cfg(feature = "snowcap")] - pub snowcap_shutdown_ping: Option, + pub snowcap_shutdown_ping: Option, } impl State {