From 8b4464fda8d1eb5dfccc664383625cf5547dd080 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Fri, 18 Jul 2025 14:37:17 +0200 Subject: [PATCH] clippy: inline format args --- input-capture/src/layer_shell.rs | 12 ++++++------ input-capture/src/lib.rs | 2 +- input-emulation/src/macos.rs | 4 ++-- input-emulation/src/wlroots.rs | 10 +++++----- input-event/src/lib.rs | 4 ++-- lan-mouse-gtk/src/window.rs | 6 +++--- lan-mouse-ipc/src/listen.rs | 2 +- src/listen.rs | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/input-capture/src/layer_shell.rs b/input-capture/src/layer_shell.rs index ab6342a..ea8a4e0 100644 --- a/input-capture/src/layer_shell.rs +++ b/input-capture/src/layer_shell.rs @@ -535,7 +535,7 @@ impl State { fn update_windows(&mut self) { log::info!("active outputs: "); for output in self.outputs.iter().filter(|o| o.info.is_some()) { - log::info!(" * {}", output); + log::info!(" * {output}"); } self.active_windows.clear(); @@ -582,17 +582,17 @@ impl Inner { match self.queue.dispatch_pending(&mut self.state) { Ok(_) => {} Err(DispatchError::Backend(WaylandError::Io(e))) => { - log::error!("Wayland Error: {}", e); + log::error!("Wayland Error: {e}"); } Err(DispatchError::Backend(e)) => { - panic!("backend error: {}", e); + panic!("backend error: {e}"); } Err(DispatchError::BadMessage { sender_id, interface, opcode, }) => { - panic!("bad message {}, {} , {}", sender_id, interface, opcode); + panic!("bad message {sender_id}, {interface} , {opcode}"); } } } @@ -974,7 +974,7 @@ impl Dispatch for State { .find(|o| o.global.name == *name) .expect("output"); - log::debug!("xdg_output {name} - {:?}", event); + log::debug!("xdg_output {name} - {event:?}"); match event { zxdg_output_v1::Event::LogicalPosition { x, y } => { output.pending_info.position = (x, y); @@ -1010,7 +1010,7 @@ impl Dispatch for State { _conn: &Connection, _qhandle: &QueueHandle, ) { - log::debug!("wl_output {name} - {:?}", event); + log::debug!("wl_output {name} - {event:?}"); if let wl_output::Event::Done = event { state.update_output_info(*name); } diff --git a/input-capture/src/lib.rs b/input-capture/src/lib.rs index debfd6d..6b4f4f8 100644 --- a/input-capture/src/lib.rs +++ b/input-capture/src/lib.rs @@ -79,7 +79,7 @@ impl Display for Position { Position::Top => "top", Position::Bottom => "bottom", }; - write!(f, "{}", pos) + write!(f, "{pos}") } } diff --git a/input-emulation/src/macos.rs b/input-emulation/src/macos.rs index 5ad6c53..0ac3dbe 100644 --- a/input-emulation/src/macos.rs +++ b/input-emulation/src/macos.rs @@ -161,12 +161,12 @@ fn get_display_at_point(x: CGFloat, y: CGFloat) -> Option { }; if error != 0 { - log::warn!("error getting displays at point ({}, {}): {}", x, y, error); + log::warn!("error getting displays at point ({x}, {y}): {error}"); return Option::None; } if display_count == 0 { - log::debug!("no displays found at point ({}, {})", x, y); + log::debug!("no displays found at point ({x}, {y})"); return Option::None; } diff --git a/input-emulation/src/wlroots.rs b/input-emulation/src/wlroots.rs index a36c7a1..9c2e73a 100644 --- a/input-emulation/src/wlroots.rs +++ b/input-emulation/src/wlroots.rs @@ -163,13 +163,13 @@ impl Emulation for WlrootsEmulation { async fn create(&mut self, handle: EmulationHandle) { self.state.add_client(handle); if let Err(e) = self.queue.flush() { - log::error!("{}", e); + log::error!("{e}"); } } async fn destroy(&mut self, handle: EmulationHandle) { self.state.destroy_client(handle); if let Err(e) = self.queue.flush() { - log::error!("{}", e); + log::error!("{e}"); } } async fn terminate(&mut self) { @@ -221,7 +221,7 @@ impl VirtualInput { self.keyboard.key(time, key, state as u32); if let Ok(mut mods) = self.modifiers.lock() { if mods.update_by_key_event(key, state) { - log::trace!("Key triggers modifier change: {:?}", mods); + log::trace!("Key triggers modifier change: {mods:?}"); self.keyboard.modifiers( mods.mask_pressed().bits(), 0, @@ -330,7 +330,7 @@ impl XMods { fn update_by_key_event(&mut self, key: u32, state: u8) -> bool { if let Ok(key) = scancode::Linux::try_from(key) { - log::trace!("Attempting to process modifier from: {:#?}", key); + log::trace!("Attempting to process modifier from: {key:#?}"); let pressed_mask = match key { scancode::Linux::KeyLeftShift | scancode::Linux::KeyRightShift => XMods::ShiftMask, scancode::Linux::KeyLeftCtrl | scancode::Linux::KeyRightCtrl => XMods::ControlMask, @@ -348,7 +348,7 @@ impl XMods { // unchanged if pressed_mask.is_empty() && locked_mask.is_empty() { - log::trace!("{:#?} is not a modifier key", key); + log::trace!("{key:#?} is not a modifier key"); return false; } match state { diff --git a/input-event/src/lib.rs b/input-event/src/lib.rs index 713c840..1d8c9ff 100644 --- a/input-event/src/lib.rs +++ b/input-event/src/lib.rs @@ -112,8 +112,8 @@ impl Display for KeyboardEvent { impl Display for Event { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Event::Pointer(p) => write!(f, "{}", p), - Event::Keyboard(k) => write!(f, "{}", k), + Event::Pointer(p) => write!(f, "{p}"), + Event::Keyboard(k) => write!(f, "{k}"), } } } diff --git a/lan-mouse-gtk/src/window.rs b/lan-mouse-gtk/src/window.rs index a512688..ef94e91 100644 --- a/lan-mouse-gtk/src/window.rs +++ b/lan-mouse-gtk/src/window.rs @@ -324,7 +324,7 @@ impl Window { pub(super) fn update_client_config(&self, handle: ClientHandle, client: ClientConfig) { let Some(row) = self.row_for_handle(handle) else { - log::warn!("could not find row for handle {}", handle); + log::warn!("could not find row for handle {handle}"); return; }; row.set_hostname(client.hostname); @@ -334,11 +334,11 @@ impl Window { pub(super) fn update_client_state(&self, handle: ClientHandle, state: ClientState) { let Some(row) = self.row_for_handle(handle) else { - log::warn!("could not find row for handle {}", handle); + log::warn!("could not find row for handle {handle}"); return; }; let Some(client_object) = self.client_object_for_handle(handle) else { - log::warn!("could not find row for handle {}", handle); + log::warn!("could not find row for handle {handle}"); return; }; diff --git a/lan-mouse-ipc/src/listen.rs b/lan-mouse-ipc/src/listen.rs index 7c9d2a0..6c700c6 100644 --- a/lan-mouse-ipc/src/listen.rs +++ b/lan-mouse-ipc/src/listen.rs @@ -45,7 +45,7 @@ impl AsyncFrontendListener { let (socket_path, listener) = { let socket_path = crate::default_socket_path()?; - log::debug!("remove socket: {:?}", socket_path); + log::debug!("remove socket: {socket_path:?}"); if socket_path.exists() { // try to connect to see if some other instance // of lan-mouse is already running diff --git a/src/listen.rs b/src/listen.rs index 03abd4b..bf0653d 100644 --- a/src/listen.rs +++ b/src/listen.rs @@ -264,7 +264,7 @@ async fn read_loop( } } } - log::info!("dtls client disconnected {:?}", addr); + log::info!("dtls client disconnected {addr:?}"); let mut conns = conns.lock().await; let index = conns .iter()