From 0e0725038dc645e4e0846f9a0de8d0b8a932e03d Mon Sep 17 00:00:00 2001 From: tcmal Date: Thu, 27 Jun 2024 00:14:53 +0100 Subject: lints --- src/config.rs | 2 +- src/conn_info/mod.rs | 5 ++--- src/log.rs | 4 ++-- src/main.rs | 6 +++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/config.rs b/src/config.rs index d1bd350..0fc7144 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,7 +7,7 @@ use xkeysym::Keysym; use crate::{ bind, conn_info::Colour, - helpers::*, + helpers::{focus_next, focus_prev, spawn}, keys::{Keybind, Keybinds}, }; diff --git a/src/conn_info/mod.rs b/src/conn_info/mod.rs index ce7934b..ac257d4 100644 --- a/src/conn_info/mod.rs +++ b/src/conn_info/mod.rs @@ -186,7 +186,7 @@ impl<'a> Connection<'a> { property: self.atoms.wm_protocols, r#type: x::ATOM_ATOM, long_offset: 0, - long_length: 100000, + long_length: 100_000, })) else { return; }; @@ -198,8 +198,7 @@ impl<'a> Connection<'a> { let supported = protocols .value::() .iter() - .find(|a| **a == event.resource_id()) - .is_some(); + .any(|a| *a == event.resource_id()); if supported { self.send_request(&SendEvent { diff --git a/src/log.rs b/src/log.rs index 5be30d3..5b1575e 100644 --- a/src/log.rs +++ b/src/log.rs @@ -15,10 +15,10 @@ macro_rules! debug { #[macro_export] macro_rules! debug_req { ($req:ident) => { - crate::debug!("seq ?: {:?}", $req) + $crate::debug!("seq ?: {:?}", $req) }; ($req:ident, $cookie:ident) => { use xcb::Cookie; - crate::debug!("seq {}: {:?}", $cookie.sequence(), $req) + $crate::debug!("seq {}: {:?}", $cookie.sequence(), $req) }; } diff --git a/src/main.rs b/src/main.rs index abefd93..d1c9a27 100644 --- a/src/main.rs +++ b/src/main.rs @@ -90,10 +90,10 @@ impl<'a> WM<'a> { // See clients/mod.rs Event::X(x::Event::ConfigureRequest(e)) => { - self.handle_configure_request(&e)? + self.handle_configure_request(&e)?; } Event::X(x::Event::ConfigureNotify(e)) => { - self.handle_configure_notify(&e)? + self.handle_configure_notify(&e)?; } Event::X(x::Event::DestroyNotify(e)) => self.handle_destroy_notify(&e), Event::X(x::Event::MapRequest(e)) => self.handle_map_request(&e)?, @@ -147,6 +147,6 @@ fn cleanup_process_children() { .unwrap(); // Immediately wait for zombie processes to die - sometimes these come from startx. - while let Ok(_) = waitpid(Pid::from_raw(-1), Some(WaitPidFlag::WNOHANG)) {} + while waitpid(Pid::from_raw(-1), Some(WaitPidFlag::WNOHANG)).is_ok() {} }; } -- cgit v1.2.3