chore: clippy

This commit is contained in:
Vukašin Vojinović 2025-10-05 14:31:25 +02:00 committed by Jacob Kauffmann
parent 267bb837f1
commit 16abcc66e1
4 changed files with 30 additions and 31 deletions

View file

@ -1,2 +1 @@
reorder_imports = true
imports_granularity = "Crate" imports_granularity = "Crate"

View file

@ -101,15 +101,15 @@ impl Dispatch<zwlr_layer_surface_v1::ZwlrLayerSurfaceV1, ()> for State {
height, height,
} => { } => {
for output in &mut state.outputs { for output in &mut state.outputs {
if let Some(fade_surface) = &mut output.fade_surface { if let Some(fade_surface) = &mut output.fade_surface
if &fade_surface.layer_surface == obj { && &fade_surface.layer_surface == obj
{
fade_surface.layer_surface.ack_configure(serial); fade_surface.layer_surface.ack_configure(serial);
fade_surface.configure(&state.inner, width, height); fade_surface.configure(&state.inner, width, height);
break; break;
} }
} }
} }
}
_ => {} _ => {}
} }
} }
@ -127,8 +127,9 @@ impl Dispatch<wl_callback::WlCallback, wl_surface::WlSurface> for State {
match event { match event {
wl_callback::Event::Done { callback_data: _ } => { wl_callback::Event::Done { callback_data: _ } => {
for output in &mut state.outputs { for output in &mut state.outputs {
if let Some(fade_surface) = &mut output.fade_surface { if let Some(fade_surface) = &mut output.fade_surface
if &fade_surface.surface == surface { && &fade_surface.surface == surface
{
if fade_surface.is_done() { if fade_surface.is_done() {
// All outputs are done fading // All outputs are done fading
if state if state
@ -146,7 +147,6 @@ impl Dispatch<wl_callback::WlCallback, wl_surface::WlSurface> for State {
} }
} }
} }
}
_ => {} _ => {}
} }
} }

View file

@ -99,8 +99,9 @@ pub async fn serve(event_sender: EventSender) -> zbus::Result<()> {
let mut name_owner_stream = dbus.receive_name_owner_changed().await?; let mut name_owner_stream = dbus.receive_name_owner_changed().await?;
while let Some(event) = name_owner_stream.next().await { while let Some(event) = name_owner_stream.next().await {
let args = event.args()?; let args = event.args()?;
if args.new_owner.is_none() { if args.new_owner.is_none()
if let zbus::names::BusName::Unique(name) = args.name { && let zbus::names::BusName::Unique(name) = args.name
{
let mut inhibitors = inhibitors.lock().unwrap(); let mut inhibitors = inhibitors.lock().unwrap();
if !inhibitors.is_empty() { if !inhibitors.is_empty() {
inhibitors.retain(|inhibitor| inhibitor.client != name); inhibitors.retain(|inhibitor| inhibitor.client != name);
@ -110,7 +111,6 @@ pub async fn serve(event_sender: EventSender) -> zbus::Result<()> {
} }
} }
} }
}
Ok(()) Ok(())
} }

View file

@ -356,7 +356,7 @@ fn main() {
}) })
.unwrap(); .unwrap();
while let Ok(_) = event_loop.dispatch(None, &mut state) {} while event_loop.dispatch(None, &mut state).is_ok() {}
} }
impl Dispatch<wl_registry::WlRegistry, GlobalListContents> for State { impl Dispatch<wl_registry::WlRegistry, GlobalListContents> for State {