From e134ef6e108b0192c48fbf9955cac0646acd3925 Mon Sep 17 00:00:00 2001 From: Danilo Spinella Date: Fri, 15 Nov 2024 11:56:15 +0100 Subject: [PATCH] fix: Apply cargo clippy fixes --- daemon/src/config.rs | 2 +- daemon/src/surface.rs | 17 ++++++----------- daemon/src/wpaperd.rs | 3 +-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/daemon/src/config.rs b/daemon/src/config.rs index bc7d035..ad27239 100644 --- a/daemon/src/config.rs +++ b/daemon/src/config.rs @@ -177,7 +177,7 @@ impl SerializedWallpaperInfo { // If there is no sorting but the group is set let sorting = if group.is_some() && sorting.is_none() { // Assign it the default one, so that we can do the group match below - Some(Sorting::default().into()) + Some(Sorting::default()) } else { sorting }; diff --git a/daemon/src/surface.rs b/daemon/src/surface.rs index 72a197c..b593c38 100644 --- a/daemon/src/surface.rs +++ b/daemon/src/surface.rs @@ -87,12 +87,11 @@ impl Surface { wl_output: WlOutput, info: DisplayInfo, wallpaper_info: WallpaperInfo, - egl_display: egl::Display, qh: &QueueHandle, xdg_state_home: PathBuf, ) -> Self { let wl_surface = wl_layer.wl_surface().clone(); - let egl_context = EglContext::new(egl_display, &wl_surface); + let egl_context = EglContext::new(wpaperd.egl_display, &wl_surface); // Make the egl context as current to make the renderer creation work egl_context .make_current() @@ -263,15 +262,11 @@ impl Surface { self.image_picker.update_current_image(image_path, index); self.renderer.start_transition(transition_time); // Update the instant where we have drawn the image - match self.event_source { - EventSource::Running(registration_token, duration, _) => { - self.event_source = EventSource::Running( - registration_token, - duration, - Instant::now(), - ); - } - _ => {} + if let EventSource::Running(registration_token, duration, _) = + self.event_source + { + self.event_source = + EventSource::Running(registration_token, duration, Instant::now()); } } // Restart the counter diff --git a/daemon/src/wpaperd.rs b/daemon/src/wpaperd.rs index 014ff45..fe64836 100644 --- a/daemon/src/wpaperd.rs +++ b/daemon/src/wpaperd.rs @@ -37,7 +37,7 @@ pub struct Wpaperd { pub registry_state: RegistryState, pub surfaces: Vec, pub config: Config, - egl_display: egl::Display, + pub egl_display: egl::Display, pub filelist_cache: Rc>, pub image_loader: Rc>, pub wallpaper_groups: Rc>, @@ -261,7 +261,6 @@ impl OutputHandler for Wpaperd { output, display_info, wallpaper_info, - self.egl_display, qh, xdg_state_home_dir, ));