Apply suggestions by rust

This commit is contained in:
2026-03-05 15:02:45 +01:00
parent e440a86d97
commit bd6f1df391
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ impl LockedSurface {
let (width, height, stride) = self.renderer.surface_info(); let (width, height, stride) = self.renderer.surface_info();
// Create buffer from pool // Create buffer from pool
let (buffer, mut canvas) = let (buffer, canvas) =
pool.create_buffer(width, height, stride, wl_shm::Format::Argb8888)?; pool.create_buffer(width, height, stride, wl_shm::Format::Argb8888)?;
// Copy pixel data to buffer // Copy pixel data to buffer
+3 -3
View File
@@ -85,7 +85,7 @@ fn lock_wayland_session(
ctrlc_exit: Arc<std::sync::atomic::AtomicBool>, ctrlc_exit: Arc<std::sync::atomic::AtomicBool>,
) -> Result<(), Box<dyn Error>> { ) -> Result<(), Box<dyn Error>> {
use smithay_client_toolkit::reexports::calloop; use smithay_client_toolkit::reexports::calloop;
use smithay_client_toolkit::reexports::calloop::timer::TimeoutAction;
use smithay_client_toolkit::{ use smithay_client_toolkit::{
compositor::{CompositorHandler, CompositorState}, compositor::{CompositorHandler, CompositorState},
output::{OutputHandler, OutputState}, output::{OutputHandler, OutputState},
@@ -694,13 +694,13 @@ fn lock_wayland_session(
let render_timer = timer::Timer::from_duration(Duration::from_millis(16)); let render_timer = timer::Timer::from_duration(Duration::from_millis(16));
event_loop.handle().insert_source( event_loop.handle().insert_source(
render_timer, render_timer,
|event, _metadata, state: &mut WaylandLock| { |_event, _metadata, state: &mut WaylandLock| {
// Update lock manager (renders to Cairo surfaces) // Update lock manager (renders to Cairo surfaces)
if let Ok(mut lock_manager) = state.lock_manager.lock() { if let Ok(mut lock_manager) = state.lock_manager.lock() {
lock_manager.update(); lock_manager.update();
// Commit each surface that has a Wayland surface // Commit each surface that has a Wayland surface
for surface in lock_manager.surfaces.iter_mut() { for surface in lock_manager.surfaces.iter_mut() {
if let Some(wl_surface) = surface.wayland_surface() { if let Some(_wl_surface) = surface.wayland_surface() {
if let Err(e) = surface.commit(&mut state.pool) { if let Err(e) = surface.commit(&mut state.pool) {
log::error!("Failed to commit surface: {:?}", e); log::error!("Failed to commit surface: {:?}", e);
} }