smithay
smithay copied to clipboard
WIP Enable `clippy::same_name_method` lint
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
?