mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-25 09:59:21 +01:00
Fix clippy warnings
This commit is contained in:
parent
23b1e9d62a
commit
350468f970
5 changed files with 18 additions and 23 deletions
|
@ -88,12 +88,9 @@ use signal::SignalState;
|
|||
#[cfg(feature = "snowcap")]
|
||||
use snowcap::Snowcap;
|
||||
use tag::Tag;
|
||||
use tokio::{
|
||||
sync::{
|
||||
use tokio::sync::{
|
||||
mpsc::{unbounded_channel, UnboundedReceiver},
|
||||
RwLock,
|
||||
},
|
||||
task::JoinHandle,
|
||||
};
|
||||
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<BoxFuture<'static, ()>>,
|
||||
#[cfg(feature = "snowcap")]
|
||||
snowcap: UnboundedReceiver<JoinHandle<()>>,
|
||||
snowcap: UnboundedReceiver<tokio::task::JoinHandle<()>>,
|
||||
}
|
||||
|
||||
/// Connects to Pinnacle and builds the configuration structs.
|
||||
|
@ -238,18 +235,16 @@ pub async fn connect() -> Result<(ApiModules, Receivers), Box<dyn std::error::Er
|
|||
tag.finish_init(modules.clone());
|
||||
layout.finish_init(modules.clone());
|
||||
signal.read().await.finish_init(modules.clone());
|
||||
|
||||
#[cfg(feature = "snowcap")]
|
||||
modules.snowcap.finish_init(modules.clone());
|
||||
|
||||
#[cfg(feature = "snowcap")]
|
||||
let receivers = Receivers {
|
||||
pinnacle: fut_recv,
|
||||
#[cfg(feature = "snowcap")]
|
||||
snowcap: snowcap_recv,
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "snowcap"))]
|
||||
let receivers = Receivers { pinnacle: fut_recv };
|
||||
|
||||
Ok((modules, receivers))
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ pub mod integration;
|
|||
pub struct Snowcap {
|
||||
/// Create layer surface widgets.
|
||||
pub layer: &'static Layer,
|
||||
/// Pinnacle integrations.
|
||||
pub integration: &'static Integration,
|
||||
}
|
||||
|
||||
|
|
2
snowcap
2
snowcap
|
@ -1 +1 @@
|
|||
Subproject commit 62dc3583cb62cc112c5ead9f634576c8109f7ac6
|
||||
Subproject commit 27ce9a2d8afb48cada5ae965e88ee6b6a141fe23
|
17
src/main.rs
17
src/main.rs
|
@ -13,10 +13,6 @@
|
|||
|
||||
use std::{
|
||||
io::{BufRead, BufReader},
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
|
@ -27,10 +23,7 @@ use pinnacle::{
|
|||
state::State,
|
||||
util::increase_nofile_rlimit,
|
||||
};
|
||||
use smithay::reexports::{
|
||||
calloop::{self, EventLoop},
|
||||
rustix::process::geteuid,
|
||||
};
|
||||
use smithay::reexports::{calloop::EventLoop, rustix::process::geteuid};
|
||||
use tracing::{error, info, warn};
|
||||
use tracing_appender::rolling::Rotation;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer};
|
||||
|
@ -183,6 +176,12 @@ async fn main() -> 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();
|
||||
})?;
|
||||
|
||||
|
|
|
@ -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<Output, Option<GlobalId>>,
|
||||
|
||||
#[cfg(feature = "snowcap")]
|
||||
pub snowcap_shutdown_ping: Option<calloop::ping::Ping>,
|
||||
pub snowcap_shutdown_ping: Option<smithay::reexports::calloop::ping::Ping>,
|
||||
}
|
||||
|
||||
impl State {
|
||||
|
|
Loading…
Reference in a new issue