diff --git a/src/backend/renderer/gles/mod.rs b/src/backend/renderer/gles/mod.rs index a59dd3cd1525..9d48e1ee0011 100644 --- a/src/backend/renderer/gles/mod.rs +++ b/src/backend/renderer/gles/mod.rs @@ -2459,7 +2459,7 @@ impl GlesFrame<'_> { /// Optionally allows a custom texture program and matching additional uniforms to be passed in. #[instrument(level = "trace", skip(self), parent = &self.span)] #[profiling::function] - #[allow(clippy::too_many_arguments)] + #[allow(clippy::same_name_method, clippy::too_many_arguments)] pub fn render_texture_from_to( &mut self, texture: &GlesTexture, diff --git a/src/desktop/space/wayland/x11.rs b/src/desktop/space/wayland/x11.rs index 2f1708a9dffd..6d54631c0fd8 100644 --- a/src/desktop/space/wayland/x11.rs +++ b/src/desktop/space/wayland/x11.rs @@ -21,7 +21,7 @@ use super::{output_update, WindowOutputUserData}; impl WaylandFocus for X11Surface { #[inline] fn wl_surface(&self) -> Option> { - self.state.lock().unwrap().wl_surface.clone().map(Cow::Owned) + self.wl_surface().map(Cow::Owned) } } diff --git a/src/desktop/wayland/layer.rs b/src/desktop/wayland/layer.rs index 1b9db5d7a7a9..a2ea1c64d16c 100644 --- a/src/desktop/wayland/layer.rs +++ b/src/desktop/wayland/layer.rs @@ -530,6 +530,7 @@ impl LayerSurface { /// Returns the underlying [`WlSurface`] #[inline] + #[allow(clippy::same_name_method)] pub fn wl_surface(&self) -> &WlSurface { self.0.surface.wl_surface() } @@ -721,6 +722,6 @@ impl LayerSurface { impl WaylandFocus for LayerSurface { #[inline] fn wl_surface(&self) -> Option> { - Some(Cow::Borrowed(self.0.surface.wl_surface())) + Some(Cow::Borrowed(self.wl_surface())) } } diff --git a/src/lib.rs b/src/lib.rs index 43202c7f24d7..1f66ff8d5a42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,10 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] -#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)] +#![warn( + missing_docs, + missing_debug_implementations, + rust_2018_idioms, + clippy::same_name_method +)] // Allow acronyms like EGL #![allow(clippy::upper_case_acronyms)] diff --git a/src/wayland/drm_syncobj/sync_point.rs b/src/wayland/drm_syncobj/sync_point.rs index 94c1e12b99ee..50e8c42652f0 100644 --- a/src/wayland/drm_syncobj/sync_point.rs +++ b/src/wayland/drm_syncobj/sync_point.rs @@ -79,6 +79,7 @@ impl DrmSyncPoint { } /// Wait for sync point. + #[allow(clippy::same_name_method)] pub fn wait(&self, timeout_nsec: i64) -> io::Result<()> { self.timeline.0.device.syncobj_timeline_wait( &[self.timeline.0.syncobj], diff --git a/src/xwayland/xwm/surface.rs b/src/xwayland/xwm/surface.rs index f6fdccf75f7f..62fc3147328b 100644 --- a/src/xwayland/xwm/surface.rs +++ b/src/xwayland/xwm/surface.rs @@ -317,6 +317,7 @@ impl X11Surface { /// shell](crate::wayland::xwayland_shell) protocol on the wayland side, /// and then committed. #[inline] + #[allow(clippy::same_name_method)] pub fn wl_surface(&self) -> Option { self.state.lock().unwrap().wl_surface.clone() }