Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Enable clippy::same_name_method lint #1556

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/renderer/gles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/desktop/space/wayland/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use super::{output_update, WindowOutputUserData};
impl WaylandFocus for X11Surface {
#[inline]
fn wl_surface(&self) -> Option<Cow<'_, WlSurface>> {
self.state.lock().unwrap().wl_surface.clone().map(Cow::Owned)
self.wl_surface().map(Cow::Owned)
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/desktop/wayland/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -721,6 +722,6 @@ impl LayerSurface {
impl WaylandFocus for LayerSurface {
#[inline]
fn wl_surface(&self) -> Option<Cow<'_, wl_surface::WlSurface>> {
Some(Cow::Borrowed(self.0.surface.wl_surface()))
Some(Cow::Borrowed(self.wl_surface()))
}
}
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]

Expand Down
1 change: 1 addition & 0 deletions src/wayland/drm_syncobj/sync_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
1 change: 1 addition & 0 deletions src/xwayland/xwm/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<WlSurface> {
self.state.lock().unwrap().wl_surface.clone()
}
Expand Down
Loading