Skip to content

Conversation

@ids1024
Copy link
Member

@ids1024 ids1024 commented Oct 2, 2024

It is confusing and error prone to have a method on a type and a trait implemented by that type with the same name.

This is particularly bad for something like <Window as SpaceElement>::bbox, which actually calls Window::bbox_with_popups. Which is different from Window::box. But these three functions have the same type signature.

It seems good to disallow this lint in general, but it can be allowed where the methods do the same thing.

Not sure how we want to resolve this. Is there a better way to name bbox/geometry to avoid duplication? "Geometry" seems like a problematically overloaded term in general...

I guess it's probably not intentional that xwm::X11Surface has two definitions of alive(), once as self.state.lock().unwrap().alive and once as self.state.lock().unwrap().alive && self.conn.strong_count() != 0?

@ids1024 ids1024 force-pushed the clippy-same_name_method branch from f14a397 to 8d192d0 Compare December 9, 2024 18:11
It is confusing and error prone to have a method on a type and a trait
implemented by that type with the same name.

This is particularly bad for something like `<Window as SpaceElement>::bbox`,
which actually calls `Window::bbox_with_popups`. Which is different from
`Window::box`. But these three functions have the same type signature.

It seems good to disallow this lint in general, but it can be allowed
where the methods do the same thing.
@ids1024 ids1024 force-pushed the clippy-same_name_method branch from 8d192d0 to b67a34e Compare January 7, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant